W3C home > Mailing lists > Public > www-dom-ts@w3.org > October 2001

Re: Regarding setNamedItem!!!

From: Curt Arnold <carnold@houston.rr.com>
Date: Tue, 16 Oct 2001 01:38:34 -0500
Message-ID: <015b01c1560d$2e3ce1b0$7600a8c0@CurtMicron>
To: "Thara S" <s_thara@rti.daimlerchrysler.com>
Cc: <www-dom-ts@w3.org>
The www-dom list is more appropriate for questions about the DOM spec,
www-dom-ts is specifically for the effort to write testing suites for the
DOM specifications.

It is unclear whether you are asking usage or implementation questions.
That is whether you are trying to use an existing DOM parser, such as
Xerces-J or MSXML, or whether you are asking how to implement these

If you haven't read
you should read it again.

> wanted to know ....What should be the lookup key used to retrieve from
NamedNodeMap? > Is it qualifiedName(two-part name containing prefix and
localName) or two-part name
> containing localName and namespaceURI?

getNamedItem and setNamedItem have no concept of qualified names, like XML
1.0, what looks like a "qualified name" is just a tag name that happens to
contain a colon and colons have no special significance.

If you are manipulating documents that have a declared namespace, you should
be exclusively using the *NS variants.

>When I have both DOM Level 1 and level 2 methods implemented, to implement
a parse
> function which parses an input XML file,what kind of checking  should
> I make to choose an appropriate method from level 1 or level 2 (the one
with namespaces).
> For example, in the input XML FILE, when I encounter an attribute node of
an element, how
> do I know whether setNamedItem or setNamedItemNS should be called?

DOM implementations will typically be able to build a tree from an XML
document (or stream of SAX events) in a manner that both DOM Level 1 calls
and DOM Level 2 calls will behave reasonably.  However, there is no
guarantee that a public user of a DOM implementation can build a tree using
*NS methods and accessing using the non NS methods or vice-versa.
Received on Tuesday, 16 October 2001 02:40:27 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:34:03 UTC