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: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] XOM 1.1: XPath
  • Date: Thu, 06 Jan 2005 20:47:17 -0500

How about this one. What does Nux return?

Element elem = new Element("elem");
elem.appendChild("hello");
elem.appendChild("world");
elem.appendChild("nux");

Nodes results = new XQuery("./child::*[2]", null).execute(elem).toNodes();
for (int i=0; i < results.size(); i++) {
System.out.println("i="+i+":" + results.get(i).toXML());
}

If XPath is properly implemented this should return an empty list. Does it?

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