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: shirasu hiroyuki <hirsh AT s9.dion.ne.jp>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XOM 1.1: XPath
  • Date: Fri, 07 Jan 2005 06:54:10 -0500

shirasu hiroyuki wrote:

Do you mean "child::text()[2]" in your XPath expression?
"child::*" select all element children, but not text nodes.

Oops. Yes.


For the XPath "./text()",
We expect one text node with "helloworldnux",
but Nux returns three text nodes.

I tend to think NUX ix correct here. If NUX returned one Text object it would have to be a different Text object than the ones actually present in the document. The mismatch between XOM and XPath in respect to adjacent text nodes/objects means that an XPath text node does not always map in a one-to-one fashion with a XOM Text object. Adjacent Text objects may together form a single text node and th XPath engine needs to so treat them.

Hmm, I think I'm beginning to see how to make this work. It should just be a simple adjustment to the various navigation functions in the navigator class (or equivalent). It may not be as hard to get this right as I feared. Then again, it may be. I haven't actually done this yet.

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