G
Grant Harmeyer
I am attempting to construct a simple ASP.NET Rss/Xml newsfeed. If anyone
has visited Don Box's Blog (http://www.gotdotnet.com/team/dbox/), you will
notice that his Rss feed is exposed through an ASP.NET page. When you load
the .aspx page in IE, it displays just as an Xml doc would (colored nodes,
expandable node heirarchy, etc.).
I would like to mimic this using the <asp:Xml /> server control and pumping
the Xml to it from a CodeBehind XmlDocument(), but for now I am just
stuffing the Xml into the control manually for testing:
<asp:Xml runat="server">
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Rss Feed</title>
<link>http://localhost/rss/</link>
<copyright>Copyright (c)</copyright>
<item>
<title>Empty Title</title>
<guid>Empty GUID</guid>
<link>Empty Link</link>
<pubDate>Empty Date</pubDate>
<description>Test Rss Xml Feed</description>
<body xmlns="http://www.w3.org/1999/xhtml">
Test
</body>
</item>
</channel>
</rss>
</asp:Xml>
When I try to load any Xml from the .aspx page, it just concatenates the
data in all nodes into one huge string, but viewing the source shows the Xml
just as I want it. This behavior even continues if all I do is load the
straight Xml into the .aspx page without the <asp:Xml /> server control. The
only conclusion I can come to is that this a mime-type issue, or I need an
XSLT stylesheet applyed to the Xml (but I am see that as the less likely
issue).
Never done much with Xml in ASP.NET, so sorry if this is elementary. TIA.
Grant Harmeyer
has visited Don Box's Blog (http://www.gotdotnet.com/team/dbox/), you will
notice that his Rss feed is exposed through an ASP.NET page. When you load
the .aspx page in IE, it displays just as an Xml doc would (colored nodes,
expandable node heirarchy, etc.).
I would like to mimic this using the <asp:Xml /> server control and pumping
the Xml to it from a CodeBehind XmlDocument(), but for now I am just
stuffing the Xml into the control manually for testing:
<asp:Xml runat="server">
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Rss Feed</title>
<link>http://localhost/rss/</link>
<copyright>Copyright (c)</copyright>
<item>
<title>Empty Title</title>
<guid>Empty GUID</guid>
<link>Empty Link</link>
<pubDate>Empty Date</pubDate>
<description>Test Rss Xml Feed</description>
<body xmlns="http://www.w3.org/1999/xhtml">
Test
</body>
</item>
</channel>
</rss>
</asp:Xml>
When I try to load any Xml from the .aspx page, it just concatenates the
data in all nodes into one huge string, but viewing the source shows the Xml
just as I want it. This behavior even continues if all I do is load the
straight Xml into the .aspx page without the <asp:Xml /> server control. The
only conclusion I can come to is that this a mime-type issue, or I need an
XSLT stylesheet applyed to the Xml (but I am see that as the less likely
issue).
Never done much with Xml in ASP.NET, so sorry if this is elementary. TIA.
Grant Harmeyer