Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Problem parsing HTML file into Document

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "John.Cowan" <jcowan AT reutershealth.com>
  • To: Nick Day <the_doctor_nick AT hotmail.com>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Problem parsing HTML file into Document
  • Date: Sun, 11 Dec 2005 23:59:16 -0500

Nick Day scripsit:
> Hi,
>
> Many thanks for the advice!
>
> I am now using TagSoup to parse HTML documents, however I have run into a
> problem when attempting to query the resulting Documents using XPath. I
> have set up a test method (bottom) which reads in a HTML page from a
> specified URL and then queries it using XPath. The matching elements are
> then printed out.

This is getting to be a FAQ. TagSoup puts elements into the XHTML namespace,
so you have to use a properly bound prefix to refer to the elements
using XPath.

--
John Cowan jcowan AT reutershealth.com www.reutershealth.com
www.ccil.org/~cowan
Big as a house, much bigger than a house, it looked to [Sam], a grey-clad
moving hill. Fear and wonder, maybe, enlarged him in the hobbit's eyes,
but the Mumak of Harad was indeed a beast of vast bulk, and the like of him
does not walk now in Middle-earth; his kin that live still in latter days are
but memories of his girth and his majesty. --"Of Herbs and Stewed Rabbit"




Archive powered by MHonArc 2.6.24.

Top of Page