DOM 3 XPath: dealing with null

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?
Both?

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.

Thanks,

Perry A. Caro
Adobe Systems Inc.

Received on Wednesday, 15 May 2002 12:03:29 UTC