|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: CDATA by any other name... (was The raw and the cooked)
Rick Jelliffe writes: > If you take the view that CDATA section labels the data as > character data (i.e. not ignorable whitespace) then <![CDATA[ ]]> > is clearly invalid in Henry's example: because the " " is marked as > data and data is not allowed. But that is emphera: what does the > spec say? > I think the answer is clear from the spec: [43] content ::= > (element | CharData | Reference | CDSect | PI | Comment)* so a > CDSect is not CharData. Therefore a CDSect is only valid in mixed > content, even though it is well-formed to have it in element > content. You're pumping the spec too hard. As I've pointed out in a previous posting, elsewhere the spec says that all non-markup-characters are character data, and in the CDATA section clause, it refers to the contents of the marked section as "character data," but I would attach no more weight to these than I would to your excerpts: if the spec had meant to make a clear statement about CDATA sections in element content, I trust that Tim and the other editors would have made the statement explicitly rather than hiding it for amateur exegetes like us to dig up. > I think this is doubly clear from the discussion of "white-space" > in [XML 2.10]: white-space for xml:space considerations (in element > content) is space added for "greater readability". <![CDATA[ ]]> > does not do this!! It disrupts readability. So from the purpose of > valid whitespace in element content it is clear that <![CDATA ]]> > is not legitimate. The text is just as important as the > productions. This is a useful statement of intent, but again, it does not answer the fundamental question -- it also relies on a subjective interpretation of readability (though one that many of us would probably share). Note, also, that by your reading, comments might also be forbidden in element content. Consider, again, the following: <!DOCTYPE a [ <!ELEMENT a (b,c)> <!ELEMENT b EMPTY> <!ELEMENT c EMPTY> ]]> <a><![CDATA[ ]]><b/><c/></a> Is a validating parser that reports an error conformant to the letter (if not necessarily the spirit) of the XML 1.0 REC? Yes. Is a validating parser that does *not* report an error conformant to letter (if not necessarily the spirit) of the XML 1.0 REC? Yes. Does this need to be fixed? YES! All the best, David -- David Megginson david@m... http://www.megginson.com/ xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||






