[Haskell-cafe] HXT : need to retrieve a part of a document by a XPath expression

Simon Odou simon.odou at gmail.com
Sat Dec 10 09:28:33 EST 2005


Hi everyone,

I am using the HXT (Haskell XML Toolbox) library to parse XML
documents. And I would like to be able to retrieve a part of a
document by a XPath expression. I saw the "getXPath" function which
nearly does the work but not exactly:

if you have the xpath  "//grandfather/father/son", calling getXPath on
the "grandfather" node gives the "son" subtree;
if you have the xpath "father/son", calling getXPath on the "father"
node gives the "son" subtree.

I would like to get the "son" subtree when I call getXPath-like on the
son. Something like:

if you have the xpath "father/son" or "//grandfather/father/son",
calling getXPath-like on the "son" node gives the "son" subtree.

I understand why getXPath is done like that. But is there an easy way
to get the previous result?

Thanks

--
Simon Odou
simon.odou at gmail.com


More information about the Haskell-Cafe mailing list