Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] getElementById (not again.... I know, but..)

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Wolfgang Hoschek <wolfgang.hoschek AT mac.com>
  • To: Jan Venema <jan.venema AT gmail.com>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] getElementById (not again.... I know, but..)
  • Date: Sat, 7 Oct 2006 14:45:53 -0700

With XPath the matching nodes in a XOM document can be found as follows:

Document doc = new Builder().build("test.xml");
Nodes results = XQueryUtil.xquery(doc, "id('foo')"); // with Nux/Saxon
Nodes results = doc.query("id('foo')"); // with Jaxen

Wolfgang.

On Oct 7, 2006, at 4:10 AM, Jan Venema wrote:

No getElementById?

I thougth ID was special in XML.
XOM tries to be correct, so why not tread ID as a first-class citizen.
And since XOM API is targetted at non-experts (from the tutorial section at
xom.nu) I think it is an omission not to include it.






Archive powered by MHonArc 2.6.24.

Top of Page