Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XPath Namespace Nodes rethink

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: Wolfgang Hoschek <whoschek AT lbl.gov>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] XPath Namespace Nodes rethink
  • Date: Mon, 31 Jan 2005 09:17:01 -0500

Wolfgang Hoschek wrote:


How would an external XPath impl (without access to XOM's private backdoors) create an XPathNamespaceNode? I guess it can't, which suggests the design is rather limited.


It can be done but it's a hack. Just create a document with the appropriate namespaces, and then use an XPath expression like //namespace::node() to grab them. This is how the unit tests for this functionality are written.

If someone discovers a compelling use case for creating these, I can expose the constructor; but if not I'd rather keep the constructors package protected. The smaller I can keep the public API the better. YAGNI.

I'm also afraid that if I expose public constructors, programmers will expect to be able to add these nodes to elements. I'm already a little worried that people (JDOM programmers especially) will be looking for the public constructors rather than looking for the write methods in Element.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page