Anyway to put xml tags into an aspx page?

Z

ZMan

I'm trying to format some data out as an RSS feed. I already have a
perfectly good ASPX page that does the same thing with an <asp:repeater> so
I figured I'd take the page change the html tags to RSS tags and it would
all work fine.

Problem is that it appears that there's no way to tell VS or the compiler
that I really do want to push out XML and it complains that the XML tags are
not valid in 'the active schema'

<%@ Page Language="C#" ContentType="text/xml" %>
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
<title>My Title</title>
<link>http://www.mylink.com</link>
<asp:Repeater ID="Body" Runat="server">
<ItemTemplate>
<item>

....you get the idea.

I get a red squiggly under <rss that says 'the active schema does not
support the element rss', and of course the <asp: is equally unrecognised. I
have an RSS xsd file but there doesn't appear to be a way of making the ASPX
honor it (and even if I could would it still barf on the <asp: tags).

[Note: I know I can do it all in the code behind with an XMLWriter and yes
I've wasted more time on this than it would have taken me to write the code
but its the principle of it !!! :) ]

Zman
 
M

mortb

I don't think there is a way to insert them directly in teh aspx file you'll
have to put literal controls in the apsx file and out put the xml tags
codewize

cheers,
mortb
 
Z

ZMan

Even asp:literals won't work becuase they have to be inside <html><body> or
<html><head> to be valid and that will obviously make it invalid RSS. You
are more than likely still correct though.

Thanks
ZMan
mortb said:
I don't think there is a way to insert them directly in teh aspx file
you'll have to put literal controls in the apsx file and out put the xml
tags codewize

cheers,
mortb


ZMan said:
I'm trying to format some data out as an RSS feed. I already have a
perfectly good ASPX page that does the same thing with an <asp:repeater>
so I figured I'd take the page change the html tags to RSS tags and it
would all work fine.

Problem is that it appears that there's no way to tell VS or the compiler
that I really do want to push out XML and it complains that the XML tags
are not valid in 'the active schema'

<%@ Page Language="C#" ContentType="text/xml" %>
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
<title>My Title</title>
<link>http://www.mylink.com</link>
<asp:Repeater ID="Body" Runat="server">
<ItemTemplate>
<item>

...you get the idea.

I get a red squiggly under <rss that says 'the active schema does not
support the element rss', and of course the <asp: is equally
unrecognised. I have an RSS xsd file but there doesn't appear to be a way
of making the ASPX honor it (and even if I could would it still barf on
the <asp: tags).

[Note: I know I can do it all in the code behind with an XMLWriter and
yes I've wasted more time on this than it would have taken me to write
the code but its the principle of it !!! :) ]

Zman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top