XmlDataSource and embeded HTML within your XML data

G

Guest

Hi,

I am attempting to right a news scroller control that is driven by and XML
file. The way I have it set up is:

<News>
<Item Title="sometitle">
html content goes here
</Item>
</News>

My hope was to be able to put the html for each news post in the middle of
the Item elememts and then fetch those using an asp:DataList. Well everything
works except that I loose my html tags. I get all the text but don't get
links, formating, etc...

I am using <%#XPath(".") %> to fetch the html content from the Xml in my
DataList control. Is there a way to have the html tags make it to the browser
using this setup?

Thanks,

Ryan
 
L

Laurent Bugnion

Hi,
Hi,

I am attempting to right a news scroller control that is driven by and XML
file. The way I have it set up is:

<News>
<Item Title="sometitle">
html content goes here
</Item>
</News>

My hope was to be able to put the html for each news post in the middle of
the Item elememts and then fetch those using an asp:DataList. Well everything
works except that I loose my html tags. I get all the text but don't get
links, formating, etc...

I am using <%#XPath(".") %> to fetch the html content from the Xml in my
DataList control. Is there a way to have the html tags make it to the browser
using this setup?

Thanks,

Ryan

I think that you need a CDATA section.
http://www.w3schools.com/xml/xml_cdata.asp

HTH,
Laurent
 
W

Walter Wang [MSFT]

Thanks Laurent for your input.

Hi Ryan,

I agree with Laurent that you will need a CDATA section to store the HTML
content. Please feel free to post here if you need more help and anything
is unclear.


Regards,
Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Top