Parsing DTD 's with CDATA elements 2003-01-15 - By Greg Hess
I have changed my DTD as suggested and all is well :-).
Many Thanks,
Greg
-----Original Message----- From: Joseph Kesselman [mailto:keshlam@(protected)] Sent: Tuesday, January 14, 2003 4:59 PM To: xerces-j-user@(protected) Subject: Re: Parsing DTD's with CDATA elements
This looks like the standard confusion between CDATA, #PCDATA, and <![CDATA[]]>
<![CDATA[]]> (a "CDATA Section") is actually a kind of #PCDATA content. It's just a syntactic convenience, as an alternative to escaping individual characters. It does not have to be specially declared in the DTD; just say that the element can contain #PCDATA and then use <![CDATA[]]> in your document, and everything should work properly.
#CDATA is the datatype used for *attributes* which contain unconstrained
text. You can't define an element as containing #CDATA, and you don't have to do so.
Yes, the fact that CDATA means two different things, and is so similar to PCDATA, is confusing. All I can say is that it makes sense to a parser developer. (It doesn't make us _happy_, but it does make sense.)
______________________________________ Joe Kesselman / IBM Research
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
|
|