From: "Dominique Devienne" <[EMAIL PROTECTED]> > Can someone explain me the difference between the two lines of XML below: > > <sometag><![CDATA[some textual content]]></sometag> > <sometag>[CDATA[some textual content]]</sometag>
See http://www.w3.org/TR/2000/REC-xml-20001006#sec-cdata-sect. The first line describes an element "sometag" which has a CDATA section child containing "some textual content". The second line describes an element "sometag" which has a text child containing "[CDATA[some textual content]]". In other words, the first line is the correct way to use a CDATA section. CDATA sections allow you to escape text that would otherwise be interpreted as markup (e.g. <foo>). > What the difference? Does it matter for the DTD? > I use <!ELEMENT sometag (#PCDATA)> for that element. Normal text and CDATA sections both qualify as PCDATA. However, you may need to treat CDATA sections specially depending on the parser and API you use. > PS: The XML spec is a little obtuse to me... And I did look at it! It is rather. I have to read very slowly and carefully ;) Ciao, Gordon -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
