OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get the 1st element in DTD




Sorry i did not use the exact names -- i have not used xml parsers from
March 2000 -- sorry for the imprecise answers --

basically you have to do this --

To get to the first element of the DTD -- I think you want to know what is
the element specified as the root using the DOCTYPE declaration --

do this --

Let the Document be doc

(doc.getDoctype ()).getName ()

Document.getDoctype () returns DocumentType --
DocumentType.getName () returns the name of the DOCTYPE declaration as a
String

regards - murali.

Note that in xml4j 1.1.16, if I remember correctly, DTD implements
DocumentType, also the method getDoctype is in the Document interface --
it is not in DTD.

On Fri, 22 Jun 2001 Bing.Li@asu.edu wrote:

> Dear Murali,
>
> I didn't get the method, getDocTypeDeclaration, in the DTD class. I use IBM
> XML Parser for Java 1.1.16. What about you?
>
> Thanks,
> Bing
>                  _________________
>                 |  How are you?  |_____    __
>                 |  I am Li Bing. |     |__|  |_________
>                 |________________| OK? |::|  | Need   /
>                 |                \.____|::|__| Help? <
>                 |                      \::/  \._______\
>    /\**/\       |   ___________________________________
>   ( o_o  )_     |__|http://www.public.asu.edu/~libing /
>    (u--u   \_)  |  |bing.li@asu.edu, 480-829-8492(H) /
>     (||___   )==\  |480-965-9038(L)480-965-1746(O)   \
>   ,dP"/b/=( /P"/b\ |__________________________________\
>   |8 || 8\=== || 8
>   `b,  ,P  `b,  ,P
>     """`     """`
>
>
> On Fri, 22 Jun 2001, Murali Mani wrote:
>
> > > I think there is something like getDocTypeDeclaration in the
> interface > Document -- please check.. > > cheers - murali. > > On
> Fri, 22 Jun 2001 Bing.Li@asu.edu wrote: > > > Dear all, > > > > Now I
> am using DOM to generate XML files. I need to get the first
element of
> > > DTD.
> > >
> > > I am able to use
> > >
> > > Enumeration en = dtd.getElementDeclarations();
> > >
> > > to get all the elements in the DTD. But I don't know which one is the first
> > > element in the DTD.
> > >
> > > I appreciate any help from you!
> > >
> > > Li Bing
> > >
> > >                  _________________
> > >                 |  How are you?  |_____    __
> > >                 |  I am Li Bing. |     |__|  |_________
> > >                 |________________| OK? |::|  | Need   /
> > >                 |                \.____|::|__| Help? <
> > >                 |                      \::/  \._______\
> > >    /\**/\       |   ___________________________________
> > >   ( o_o  )_     |__|http://www.public.asu.edu/~libing /
> > >    (u--u   \_)  |  |bing.li@asu.edu, 480-829-8492(H) /
> > >     (||___   )==\  |480-965-9038(L)480-965-1746(O)   \
> > >   ,dP"/b/=( /P"/b\ |__________________________________\
> > >   |8 || 8\=== || 8
> > >   `b,  ,P  `b,  ,P
> > >     """`     """`
> > >
> > >
> > >
> > >
> > > ------------------------------------------------------------------
> > > The xml-dev list is sponsored by XML.org, an initiative of OASIS
> > > <http://www.oasis-open.org>
> > >
> > > The list archives are at http://lists.xml.org/archives/xml-dev/
> > >
> > > To unsubscribe from this elist send a message with the single word
> > > "unsubscribe" in the body to: xml-dev-request@lists.xml.org
> > >
> >
> >
>
>