You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Joseph Kesselman <ke...@us.ibm.com> on 2002/08/14 20:38:52 UTC

Re: defining CDATA for elements

>how can i define an element to only contain CDATA ?? 

If you mean a <![CDATA[]]> section... you can't. As far as XML is 
concerned, this is purely a syntactic item, not semantic -- it's just an 
alternative to manually escaping individual characters that may have 
special meaning, and the distinction between the two approaches shouldn't 
be meaningful to most XML applications. 

(The DOM and SAX APIs do tell you where the boundaries of CDATA Sections 
are, but that's intended for the _rare_ application -- mostly editors -- 
where the difference matters to a human. It should never matter to a 
program.)

______________________________________
Joe Kesselman  / IBM Research

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org