When you parse a document with dom4j you can get access to the DTD after parsing via the DocumentType.getExternalDeclarations() or DocumentType.getInternalDeclarations(). Take a look at the org.dom4j.dtd package for the objects you get access too. You need to enable this via the properties on the SAXReader, e.g. SAXReader.setIncludeInternalDTDDeclarations(true),

For a DTD object model with a parser of just DTDs you could try DTDParser.
 
 
Or you could try using MSV from Sun which is schema-agnosic and can read DTDs, XML Schema, RelaxNG, Relax & TREX - though it may be a bit more complex to use as its more higher level than DTDParser.
 
James
----- Original Message -----
Sent: Saturday, February 16, 2002 4:24 PM
Subject: [dom4j-user] DTD Object Model

Hi;
 
Is there anything out there that can read a DTD and return an object model of the DTD?
 
thanks - dave

Reply via email to