Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Node.query final

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Blaine R Southam <bsoutham AT gmail.com>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Node.query final
  • Date: Mon, 25 Sep 2006 15:53:36 -0400

Blaine R Southam wrote:
Miachael,

I understand that breaking the interface contract is a bad thing. But how
is it that I would be breaking the interface contract? The only thing that
I'm doing is providing a different hardcoded value as the default. Rather
than using the default namespace of an empty string to the query method, I
would be providing a default of my specific namespace. It still conforms to
the XQuery/XPath specification.


It sounds like you might misunderstand how XPath works, and that's what really worries me. In XPath 1.0 an expression such as foo/bar/baz the three names foo, bar, and baz are *always* in no namespace. It is not that there is a default namespace. There is no namespace, and even if there were foo, bar, and baz would still be in no namespace. In XPath 1.0, unprefixed names are *never* in a namespace. This is not XOM. This is XPath; and while I don't always agree with the design of everything in XPath, I am certain more harm than good would be caused by deviating from the spec.

Perhaps you wanted instead to prebind a prefix in expressions like pre:foo/pre:bar/pre:baz? That might arguably not be de jure wrong; but I don't see how you could pick a standard prefix and a URL. In the long run, that seems more likely to confuse than requiring users to choose their own prefixes and explicitly map them.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/




Archive powered by MHonArc 2.6.24.

Top of Page