Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Re: Java and parsing XHTML (luca)

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: Hallvard Trætteberg <hal AT idi.ntnu.no>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Re: Java and parsing XHTML (luca)
  • Date: Thu, 09 Sep 2004 14:48:48 -0400

Hallvard Trætteberg wrote:


If you're only interested in img elements, you needn't build a full
document and traverse it. Using Jaxen/XPath is definitely overkill for
this case. XOM's node factory (don't remember the class name) supports
creating only the nodes you're really interested in, to save space and
time. Implement a custom NodeFactory (?) that only creates and Element
if the name is img.



Now why didn't I think of that? You wouldn't even have to build most of the document, and the parse would do the traversal for you. This should be much faster and more efficient than using XPath.

--
Elliotte




Archive powered by MHonArc 2.6.24.

Top of Page