You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Stuart D Jackson <st...@jhu.edu> on 2000/06/30 20:48:58 UTC

DocumentTypeImpl

I am trying to traverse a DTD in memory, but I am having problems.
Whenever I call NodeMap = DocumentTypeImpl.getElements(), the only nodes
in the NodeMap are Elements tht have Attributes defined for them.  In
other words, calling getElements on

<!ELEMENT a ( b, c )>

<!ELEMENT b ( #PCDATA ) >
<!ATTLIST b e-dtype NMTOKEN  #FIXED 'int' >

<!ELEMENT c ( #CDATA ) >

will return a Node for b, but not for a or c.  On the other hand, 

<!ELEMENT a ( b, c )>
<!ATTLIST a e-dtype NMTOKEN  #FIXED 'int' >

<!ELEMENT b ( #PCDATA ) >
<!ATTLIST b e-dtype NMTOKEN  #FIXED 'int' >

<!ELEMENT c ( #CDATA ) >
<!ATTLIST c e-dtype NMTOKEN  #FIXED 'int' >

will return Nodes for a, b, and c.

Am I missing something, or is this a bug?

Thanks a lot.

-Stuart Jackson


Re: DocumentTypeImpl

Posted by Andy Clark <an...@apache.org>.
Stuart D Jackson wrote:
> Am I missing something, or is this a bug?

You are neither missing something nor is this a bug. The DOM
implementation is working as designed. The element definitions
are only for default attributes.

The DOM currently does not define how a DTD grammar is 
represented in the document or require an implementation to
supply this information.

-- 
Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org