W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2002

DOM 3 XPath: dealing with null

From: Perry A. Caro <caro@adobe.com>
Date: Mon, 29 Apr 2002 21:31:09 -0400 (EDT)
Message-ID: <3CCDF385.F352884A@adobe.com>
To: www-dom@w3.org, caro@adobe.com
All of these issues revolve around clarifying how and when to handle null as
an allowed/expected value, particularly for empty nodesets.  I can guess at
what's intended with pretty high confidence, but the point of a spec is that
I shouldn't have to guess.

Issue: empty nodeset vs. snapshot types

If a snapshot result type is requested, how is an empty nodeset
represented?  As snapshotLength being 0? As snapshotItem(0) returning null?

Issue: snapshotItem() of invalid index

The spec says that an invalid index returns null, yet an index value that is
greater than the snapshotLength is always a usage error. Consider throwing
an exception for the usage error cases.

Issue: empty nodeset vs. iteration types

If an interation type is requested, how is an empty nodeset represented? By
iterateNext() returning null on the first call?

Issue: Can XPathResult stringValue ever be null?

None of the functions that return strings in the XPath spec can return null.
Nevertheless, the DOM 3 XPath spec should make it clear whether stringValue
may ever be null, particularly for those of us who plan to include
extensions to the function suite.


Perry A. Caro
Adobe Systems Inc.
Received on Wednesday, 15 May 2002 12:03:29 UTC

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