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.
--
Kumar.A.P.P
Software Engineer, Infosys Technologies Limited.
http://geekswithblog.squarespace.com

Re: CDATA by Joe

Joe
Mon Oct 08 08:40:56 PDT 2007

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.


--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

"Kumar.A.P.P" <KumarAPP@discussions.microsoft.com> wrote in message
news:3BA5827D-0338-42E3-A327-850436488DA1@microsoft.com...
>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.
> --
> Kumar.A.P.P
> Software Engineer, Infosys Technologies Limited.
> http://geekswithblog.squarespace.com



Re: CDATA by guffa

guffa
Mon Oct 08 09:20:09 PDT 2007

Kumar.A.P.P wrote:
> 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.

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.

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