To the best of my recollection, Altova's free XMLSpy had a utility that would allow you to take either a DTD or an XML Schema (tools exist to go from DTD to Schema) and generate a small sample XML file that corresponds to that DTD/Schema. Whether such would be sufficient to generate a parser for that particular XML file, I cannot say.
However, you might have a larger problem. When I open your DTD in my installed version of XMLSpy, I get the following error:
This file is not well-formed: % expected.
IMHO, you probably need to address this issue (hopefully just an error of copy & paste) before addressing larger issues of parsing DTDs, Schemas, or XML.
Since XML Schemas are themselves written in XML (and well-tested parsers already exist for XML), I would try (1) Fixing the error described above; (2) Converting DTD to XSD; (3) using an existing XML Parser on the result.
I have included a few links (unchecked to see if they are still "up"), that may be of use:
a Perl program that can translate DTDs to XSD, link 1
a Perl program that can translate DTDs to XSD, link 2
HTH,
planetscapeIn reply to Re: Parsing an XML-like definition of an XML-like language to create a parser of the actual data in that language.
by planetscape
in thread Parsing an XML-like definition of an XML-like language to create a parser of the actual data in that language.
by Moron
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |