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 Stephen Crawley <cr...@dstc.edu.au> on 2000/12/07 01:11:39 UTC

Re: Bug in Xerces 1.2.2 (?) -- getElementById() fails without validation

> 
> Without a DTD to specify what attributes are IDs, there are no IDs, hence
> getElementById() is useless.
>

This explanation does not apply in my case.

The "xmi.id" attribute that identifies an element is declared in the DTD
to have type ID.  What is more, the "xmi.idref" attribute that is used
to create the links is declared with type IDREF.  The DTD URL is given
in the document header, and when I switch on validation, the parser
finds it.

-- Steve





Re: Bug in Xerces 1.2.2 (?) -- getElementById() fails without validation

Posted by Andy Heninger <an...@jtcsv.com>.
All of the XML ID / IDRef mechanism, including

   Values of type ID must match the Name production
   No element may have more than one ID attribute specified.
   Values of type IDREF must match the value of an ID attribute
      on some element in the doc
   and several more

are XML validity contraints, and only enabled when validation
is turned on.  See http://www.w3.org/TR/Rec-xml.html#sec-attribute-types

The non-validating parser uses entity declarations from the DTD, but not
much more.

Andy Heninger
IBM XML Technology Group, Cupertino, CA
heninger@us.ibm.com



----- Original Message -----
From: "Stephen Crawley" <cr...@dstc.edu.au>
To: <xe...@xml.apache.org>; <xe...@xml.apache.org>
Cc: <cr...@dstc.edu.au>
Sent: Wednesday, December 06, 2000 4:11 PM
Subject: Re: Bug in Xerces 1.2.2 (?) -- getElementById() fails without
validation


> >
> > Without a DTD to specify what attributes are IDs, there are no IDs,
hence
> > getElementById() is useless.
> >
>
> This explanation does not apply in my case.
>
> The "xmi.id" attribute that identifies an element is declared in the DTD
> to have type ID.  What is more, the "xmi.idref" attribute that is used
> to create the links is declared with type IDREF.  The DTD URL is given
> in the document header, and when I switch on validation, the parser
> finds it.
>
> -- Steve
>
>