[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell-cafe
Subject:    Re: [Haskell-cafe] Predicates in HaXml
From:       Tom Spencer <t.e.spencer () gmail ! com>
Date:       2004-11-21 11:52:51
Message-ID: 84a05a7804112103523eaa0b13 () mail ! gmail ! com
[Download RAW message or body]

> This is probably the simplest way of doing your specific task, but
> there are of course other ways.  The tool Xtract has a parser for
> XPath-like expressions, including more complex predicates, which get
> translated directly to combinator-style accessors.  Unfortunately,
> the set of combinators used in Xtract is slightly different from
> those in the rest of HaXml, but they bear a close relationship.

Before i start, I apologise for the simplicity of these questions, here goes:

I am just trying out a few things with the Xtract tool. I have a
simple XML document:

<greetings>
<greeting>hello</greeting>
<greeting>world</greeting>
</greetings>

I am using the Xtract query /greetings/greeting[1]/- hoping to get the
text "world"
e.g.
mkElem "h1" [applypred (keep) (parseXtract "/greetings/greeting[1]/-")]

but this just returns the entire xml document. Have i got something
fundamentally wrong here?

Thanks
Tom Spencer

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic