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 Subbarao Cheekatimarla <ch...@gmail.com> on 2005/09/05 09:06:51 UTC

Need help - in case if DTD is embeded in the XML file

Hi,

I am trying to extract the DTD element from the document. DTD is embeded in 
the xml file itself. If I use the xerces 1.4.4 parser and parse the xml, the 
Document object is having DocumentType which contains the DTD element. If I 
use the xerces 2.0 parser and parse the samle xml, the Document object is 
not having DocumentType. The DocumentType is null in this case. Any thoughts 
how to get the DocumentType (when the DTD is embeded in the xml) by using 
xerces 2.0?

Sample Xml Example:- 

<!DOCTYPE person1 [
<!ELEMENT address (#PCDATA) >

<!ELEMENT name (#PCDATA) >

<!ELEMENT person ((id)?,(name)?,(address)?)>

<!ELEMENT id (#PCDATA) >
]>
<person>
<id>1</id>
<name>1</name>
<address>1</address>
</person>

Thanks,
Subbarao