Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / October 2007

Tip: Looking for answers? Try searching our database.

CDATA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kumar.A.P.P - 08 Oct 2007 14:33 GMT
I have the XML file content as

<resources>
   <html><![CDATA[<B>Hello World</B>]]></html>
</resources>

and my html file content is

<html><![CDATA[<B>Hello World</B>]]></html>

the XML file when viewed doesnt give me any problem, but when it comes to
HTML the output that i recieve is

Hello World]]>

In order to remove the square bracket and the angle bracket in the HTML I
make the following correction:
HTML:
<html><![CDATA[<B>Hello World</B></html>
XML:
<resources>
   <html><![CDATA[<B>Hello World</B></html>
</resources>

But now XML throws an error and HTML works fine.

Thanks for any help.
Signature

Kumar.A.P.P
Software Engineer, Infosys Technologies Limited.
http://geekswithblog.squarespace.com

Joe Fawcett - 08 Oct 2007 16:40 GMT
I think this would be better posted in one of the XML groups.
How are you transforming to HTML from the XML? As far as I know HTML doesn't
really support CDATA sections and storing HTML within a CDATA section in XML
invariably leads to problems down the line.

Signature

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

>I have the XML file content as
>
[quoted text clipped - 23 lines]
>
> Thanks for any help.
Göran Andersson - 08 Oct 2007 17:20 GMT
> I have the XML file content as
>
[quoted text clipped - 23 lines]
>
> Thanks for any help.

You are mixing xhtml with html.

CDATA is only recognised in xhtml, so you have to add doctype and
namespace to the page to make it xhtml (or perhaps configure the server
to serve the file as text/xml).

The data that you put in the page is html (as it has upper case element
names), so you have to turn it into xhtml to work.

Signature

Göran Andersson
_____
http://www.guffa.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.