Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XOM 1.1: XPath

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: "'Bradley S. Huffman'" <hip AT a.cs.okstate.edu>, xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XOM 1.1: XPath
  • Date: Mon, 10 Jan 2005 13:29:58 -0500

Wolfgang Hoschek wrote:

Everybody already understands XPath's adjacent text semantics since the beginning of this thread.
But that's not the question. The question is why would output 1 *always* be the "right" thing, as opposed to output 2 or 3, or even output 4 (which is returning the first Text node as DOM XPath seems to do, as noted by Mike). In other words how to map XPath results on output to XOM nodes.

Because an XPath query has a clear meaning when operating over an XML document. There's no ambiguity as to how contiguous sequences of characters in PCDATA should be treated in a statement like //data/text()[2] or //node()[17]. Either the expression matches all of the characters as a group or it matches none of them. The incidental fact that these sequences of characters may currently be represented in 1, 2, or more XOM Text objects doesn't mean anything more than that they may be represented in 1, 2, or more bytes. The XOM object model is an implementation detail on which the XPath engine sits. The object model boundaries should not affect the results of an XPath query.

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