Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] loop in loop? xpath?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Laurent Bihanic <laurent.bihanic AT atosorigin.com>
  • To: luca passani <passani AT eunet.no>
  • Cc: xom <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] loop in loop? xpath?
  • Date: Tue, 01 Apr 2003 14:15:34 +0200


luca passani wrote:

Assuming I have a bit of XML like the following, what's the best (most efficient) way to retrieve the list of capability names and stick them into an ArrayList?

I already have:

Element genericElement = (Element)deviceElementsList.get("generic");

I can only think of nested loops, but maybe there is some XOM shorthand notation?
What about XPATH?

Sure, you can use XPath with an expression such as "//capability" which retrieves all capability nodes at any level in the document.

As XOM does not yet integrate XPath, you can use the adapter for the Jaxen XPath engine I posted on the mailing list earlier.

Laurent



  • Re: [XOM-interest] loop in loop? xpath?, Laurent Bihanic, 04/01/2003

Archive powered by MHonArc 2.6.24.

Top of Page