You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Ryan Koss <rk...@acmepacket.com> on 2001/02/20 21:17:36 UTC

reading a DTD

Hello again,

Is there any way for me read in a DTD and extract the Data elements and
their attributes from a DTD.  For instance I want to build a data dictionary
so to speak and based on certain inputs I want to read in the corresponding
DTD and have the data dictionary tell what elements make up this root node
and the attributes of these elements.  Is this possible or am I just wishing
for the stars.

-ryan


Re: reading a DTD

Posted by Dean Roddey <dr...@charmedquark.com>.
Create a dummy file, which can be an in-memory string, which references the
DTD. Parse the file, and ignore the error that your root element wasn't
found (because you won't know what to make your root element unless you
already know of some element in the DTD.) Then you can enumerate the DTD
info. Look at the EnumVal example.

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"We're gonna need a bigger boat"


----- Original Message -----
From: "Ryan Koss" <rk...@acmepacket.com>
To: <xe...@xml.apache.org>
Sent: Tuesday, February 20, 2001 12:17 PM
Subject: reading a DTD


> Hello again,
>
> Is there any way for me read in a DTD and extract the Data elements and
> their attributes from a DTD.  For instance I want to build a data
dictionary
> so to speak and based on certain inputs I want to read in the
corresponding
> DTD and have the data dictionary tell what elements make up this root node
> and the attributes of these elements.  Is this possible or am I just
wishing
> for the stars.
>
> -ryan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>