How can I have ']]>' as a text inside CDATA in xml

Neeraj Agrawal

Usenet Archive
Joined
Oct 7, 2002
Messages
2
Reaction score
0
I have a text which may have character sequence ']]>' and I want to put it inside a CDATA tag. Is it possible to encode this secquence in the xml ?

Thanks in advance
-Neeraj
 

Dimitre Novatchev

Usenet Archive
Joined
Nov 7, 2000
Messages
737
Reaction score
0
I have a text which may have character sequence ']]>' and I want to
put it inside a CDATA tag. Is it possible to encode this secquence in the xml ?

Yes -- split it in two CDATA sections, e.g.:

<a><![CDATA[A CDATA text with a ]]]]><![CDATA[> in it]]> </a>

=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
 

Julian F. Reschke

Usenet Archive
Joined
Aug 22, 2000
Messages
329
Reaction score
0
Dimitre Novatchev said:
I have a text which may have character sequence ']]>' and I want to put it inside a CDATA tag. Is it possible to encode this secquence in the xml ?

Yes -- split it in two CDATA sections, e.g.:

<a><![CDATA[A CDATA text with a ]]]]><![CDATA[> in it]]> </a>

Or alternatively don't put it into a CDATA section in the first place (just escape "&" as "& a m p ;" and "<" as "& l t ;").

Julian
 

Richard Tobin

Usenet Archive
Joined
Jan 6, 2000
Messages
4,251
Reaction score
0
Dimitre Novatchev said:
Yes -- split it in two CDATA sections, e.g.:

<a><![CDATA[A CDATA text with a ]]]]><![CDATA[> in it]]> </a>

You can regard ]]]]><![CDATA[> as an escape for ]]> if you like.

-- Richard
 

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
548,042
Messages
3,104,223
Members
248,131
Latest member
Tonypshaw1

Latest Threads

Top