Chris Gokey wrote:
> I tried you mentioned, but it did not work.

You are right. The DocumentTypeImpl#getElements() method only 
returns elements with default attribute values -- that's where
those things are stored. There is no DTD information there.

In XML4J 1.x we had a series of proprietary DTD nodes that
we added so that you can ask all of the questions that you 
want. However, we've dropped this altogether in hopes that
DOM Level 3 will define equivalent functionality.

However, having said that, we *do* have an experimental 
feature on the parser that stores the grammar information.
Check the Features doc page for 1.0.2 for the following
feature:

  http://apache.org/xml/features/domx/grammar-access

In short, it stores the grammar for the document as children
of the DocumentType node in XML Schema representation --
even if it was a DTD to start with! Of course, you'd have
to write code to crawl this tree and extract the information
that you need.

NOTE: The Schema representation follows the December draft.
      It has since changed and we'll need to update it. Are
      you looking for a fun project? ;)

-- 
Andy Clark * IBM, JTC - Silicon Valley * [EMAIL PROTECTED]

Reply via email to