[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml-apache-general
Subject:    How to scan/parse a DTD?
From:       mccull1 () us ! ibm ! com
Date:       2000-03-31 15:24:52
[Download RAW message or body]




Hello,

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.

-Andy


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic