W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2001

Document.getElementById() in XML documents

From: David Flanagan <david@oreilly.com>
Date: Sun, 29 Jul 2001 22:10:19 -0700
Message-ID: <3B64EC3B.269816FC@oreilly.com>
To: www-dom@w3.org
The DOM Level 2 spec has this to say about Document.getElementById():

"Note: The DOM implementation must have information that says which
attributes are of type ID. Attributes with the name "ID" are not of type
ID unless so defined. Implementations that do not know whether
attributes are of type ID or not are expected to return null."

I'm surprised by that last sentence, and I'd like to know whether that
is actually how things are implemented in practice.  Although I haven't
done it myself, I gather that the latest web browsers can display XML
documents when they've got an appropriate stylesheet.  I doubt that
those browsers are actually going out and parsing a DTD to determine the
type of each attribute, but I'd also really be surprised if they don't
just make getElementById() work with attributes named "ID".  In
practice, this seems like too important a method to break over a
technicality like this.

I'd be interested to hear from anyone who can comment on how this issue
is actually being handled in practice.

    David Flanagan
Received on Monday, 30 July 2001 01:10:54 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:08 UTC