Thanks for your reply Paul,
Regarding on the new error message you mentioned, there seems exist some
certain character that make the XSLT transformor complain about. I suggest
you first save the RSS XML document(get from the Syndication object) into a
xml file and then open it in IE to see whether IE will detect any well-form
validation error. You can also try using a simple RSS collection so that
you can also open the saved XML document and check it in some text editor.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>Thread-Topic: xslt and System.ServiceModel.Syndication
>thread-index: Achn8QRDXF8dmdNBRpuVMxLsXmxj0A==
>Subject: RE: xslt and System.ServiceModel.Syndication
>Date: Tue, 5 Feb 2008 04:17:03 -0800
>Steven,
>
[quoted text clipped - 45 lines]
>>
>> Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
>> ications.
>>
[quoted text clipped - 53 lines]
>> >Thanks
>> >Paul
Paul - 11 Feb 2008 10:53 GMT
Hi guys,
Thanks for the input. My problems were in the underlying memory streams,
sorry but I can't recall the detail now.
Here is the final method I used to emit from my aspx page:
Private Sub WriteOutput()
Dim feed As SyndicationFeed = New SyndicationFeed
feed = GetARSFeed()
'feed = getDummyFeed()
Dim Title As TextSyndicationContent = New
TextSyndicationContent(_FeedInfo.FeedName)
Dim Description As TextSyndicationContent = New
TextSyndicationContent(_FeedInfo.FeedDescription)
feed.Title = Title
feed.Description = Description
Select Case _FeedInfo.OutputFormat
Case "Raw RSS"
Dim memstream As New MemoryStream
Dim rssWriter As XmlWriter = XmlWriter.Create(memstream)
Dim rssFormatter As Rss20FeedFormatter = New
Rss20FeedFormatter(feed)
rssFormatter.WriteTo(rssWriter)
rssWriter.Flush()
memstream.Seek(0, SeekOrigin.Begin)
Dim xslReader As XmlReader = XmlReader.Create(memstream)
Response.ContentType = "text/xml"
Dim r As New StreamReader(memstream)
memstream.Seek(0, SeekOrigin.Begin)
Response.Write(r.ReadToEnd)
Response.End()
Case "Raw ATOM"
Dim memstream As New MemoryStream
Dim rssWriter As XmlWriter = XmlWriter.Create(memstream)
Dim atomFormatter As Atom10FeedFormatter = New
Atom10FeedFormatter(feed)
atomFormatter.WriteTo(rssWriter)
rssWriter.Flush()
memstream.Seek(0, SeekOrigin.Begin)
Dim xslReader As XmlReader = XmlReader.Create(memstream)
Response.ContentType = "text/xml"
Dim r As New StreamReader(memstream)
memstream.Seek(0, SeekOrigin.Begin)
Response.Write(r.ReadToEnd)
Response.End()
Case "RSS Presented as Formatted HTTP"
Dim memstream As New MemoryStream
Dim rssWriter As XmlWriter = XmlWriter.Create(memstream)
Dim rssFormatter As Rss20FeedFormatter = New
Rss20FeedFormatter(feed)
rssFormatter.WriteTo(rssWriter)
rssWriter.Flush()
Dim xslt As New Xsl.XslCompiledTransform()
xslt.Load(_FeedInfo.XSLTFileName)
memstream.Seek(0, SeekOrigin.Begin)
Dim xslReader As XmlReader = XmlReader.Create(memstream)
Dim newmem As New MemoryStream
xslt.Transform(xslReader, Nothing, newmem)
Response.ContentType = "text/HTML"
Dim r As New StreamReader(newmem)
newmem.Seek(0, SeekOrigin.Begin)
Response.Write(r.ReadToEnd)
Response.End()
End Select
> Thanks for your reply Paul,
>
[quoted text clipped - 145 lines]
> >> >Thanks
> >> >Paul
Steven Cheng[MSFT] - 12 Feb 2008 03:06 GMT
Thanks for your followup.
I'm glad that you've got it working and also thanks for your sharing.
Have a nice day.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: =?Utf-8?B?UGF1bA==?= <vis@nospam.nospam>
>Subject: RE: xslt and System.ServiceModel.Syndication
>Date: Mon, 11 Feb 2008 02:53:03 -0800
>Hi guys,
>
[quoted text clipped - 155 lines]
>> >>
>> >> Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
>> >> ications.
>> >>
[quoted text clipped - 63 lines]
>> >> >Thanks
>> >> >Paul