[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Discussion about XML Specification(SE)


xml specification cdata
This is one of those common misconceptions.

First of all, if you want to include ]]> in a single CDATA section, you
simply cannot.  In order to accomplish this, you need to break the text up
into two text nodes, where the first text node contains at least ] and at
most ]], and the second contains ]> or >.  The reason that you need to
escape the > in ]]> is for compatibility with SGML parsers, which recognize
this as a special sequence [a marked section end] in text and cause parsing
errors.

Some parsers and DOM implementations will quietly merge adjacent text nodes
on input.  The DOMM also contains a method to normalize adjacent text nodes
into a single node, so having to use two text nodes for the data is usually
not a problem.

Text inside <![CDATA[ ]]> does not undergo replacement. In SGML terms, it is
character data, which, unlike replacable character data, is not subject to
any substitutions whatsoever.

	Keith

-----Original Message-----
From: Collin [mailto:collin@s...]
Sent: Tuesday, October 15, 2002 10:41 PM
To: xml-dev@l...
Subject:  Discussion about XML Specification(SE)


Hi,all:
    The following is an actual text in XML Specification(SE).
<originText>
        The right angle bracket (>) may be represented using the string
"&gt;", and         must, for compatibility, be escaped using "&gt;" or a
character reference             when it appears in the string "]]>" in
content, when that string is not             marking the end of a CDATA
section.
</originText>
    According to the above description, we are supposed to escape '>' using
'&gt;'.
But the problem is that is there another way for us, in the content of CDATA
section, to write the '>' in ']]>' without using a '&gt;'?
    I find out there isn't such a method. So actuall we MUST do that,
instead of FOR COMPATIBILITY, which is descripted in the XML
specification(SE).

Collin



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.