You can use the Xerces parser for that. Look at the EnumVal program.
Basically, you just build a trivial file in memory that references the DTD
you want to parse. Then parse the file. That will parse the DTD and load it
up into the validator. You can then enumerate the various bits of
information that the validator contains. That would probably suit your
purposes. You'll get an error that your root element is not defined in most
cases, since you probably don't know what the elements in the DTD are, but
just ignore it, since by that time the DTD is already parsed. If you do know
some legal element in the DTD, then you can create your simple in memory
file to use that for its root element. See the MemParse sample for how to
parse a memory file.

--------------
Dean Roddey
Software Geek Extraordinaire
Portal, Inc
[EMAIL PROTECTED]



-----Original Message-----
From: Ian Sweeny [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 30, 2001 7:57 AM
To: [EMAIL PROTECTED]
Subject: RE: DTD Parsers?


I don't want to parse XML with DTD validation (i can do that
already thanks)

I want to parse actual DTD's, as the post says.

I'm not worried what it parses down to, just as long as
its a structured format that I can use.

Otherwise I'll have to write something myself which I don't
have time to do.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 30 May 2001 15:21
To: [EMAIL PROTECTED]
Subject: Re: DTD Parsers?


     You may find the XercesLib1_4 at
http://xml.apache.org/dist/xerces-c/stable/, which
has a DOMParser and a SAXParser can do parse xml file and do DTD
validation. Have
a look at "build instruction" and "samples" which may help you to learn how
to use those
parsers.


Regards,

Peiyong Zhang
____________________________________________
XML Parsers Development
IBM Toronto Laboratory email: [EMAIL PROTECTED]
Phone: (416)448-4088; Fax: (416)448-4414; T/L: 778-4088



Ian Sweeny <[EMAIL PROTECTED]> on 05/30/2001 09:46:05 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  DTD Parsers?



I am looking for DTD C++ parsers. Does anyone know of any?
Thanks in advance.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to