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: Wolfgang Hoschek <whoschek AT lbl.gov>
  • To: Elliotte Harold <elharo AT metalab.unc.edu>
  • 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: Tue, 11 Jan 2005 13:36:28 -0800

I'm giving up. Perhaps someone else can explain to Elliotte that we're not talking about how to generate XPath results from XOM. We're talking about how to map XPath results back to XOM on output. And if it turns out that there's no single right way to map them back, as is evident from the variety of examples that have been brought up by others, one might as well take that into account.

Wolfgang.

On Jan 10, 2005, at 10:29 AM, Elliotte Harold wrote:

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