xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mccu...@us.ibm.com
Subject How to scan/parse a DTD?
Date Fri, 31 Mar 2000 15:24:52 GMT


I would like to be able to scan/parse a DTD for information about the
declared elements, etc, for the purpose of generating java code/java
classes based on the DTD specification.  I am already accomplishing this by
parsing a complete example xml file which is generated from the DTD (with a
little tweaking to catch OR relationships & multiplicities), but certain
issues still remain, which could be solved by generating directly from
information in the DTD.  In addition, I would like the additional
information the DTD can provide me, such as which elements are required vs.
optional, etc.  Not to mention, I think it is a better, more robust, more
elegant solution.

I have been looking through the apache.xerces XML4J parser classes, and see
the XMLDTDScanner class, which seems (at least on the surface) to be close
to what I want.  Could someone maybe confirm/deny this?  More importantly,
has anyone done this?  At the moment it seems like a hell of a learning
curve before I could actually get anywhere, so if someone could help me
out, I would appreciate it.


Andrew B. McCullough
Object Technology Group, IBM Global Services
(704)594-2258                         [794-2258  TieLine]
(704)595-2525 (FAX)             [794-2525  TieLine]

View raw message