HXT: Gathering text from Nodes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

HXT: Gathering text from Nodes

aditya siram-2
Hi all,
I'm having trouble using HXT to gather up text from all nodes with a certain
name, and return it in a tuple with another node.

So given 3 child nodes called "kid" containing "a", "b" and "c", and 1 child
node called "name" containing "A", I want to return ("A", ["a","b","c"]). My
current code at
http://hpaste.org/fastcgi/hpaste.fcgi/view?id=6187#a6187returns
[("A","a")("B","b")("C","c")].

Any help is appreciated.
-deech
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090623/e0e25e14/attachment.html
Reply | Threaded
Open this post in threaded view
|

[SOLVED]Re: HXT: Gathering text from Nodes

aditya siram-2
The trick was using listA to gather up the results of the computation.
Working code is at http://hpaste.org/fastcgi/hpaste.fcgi/view?id=6187#a6188.


-deech

On Tue, Jun 23, 2009 at 2:20 PM, aditya siram <[hidden email]>wrote:

> Hi all,
> I'm having trouble using HXT to gather up text from all nodes with a
> certain name, and return it in a tuple with another node.
>
> So given 3 child nodes called "kid" containing "a", "b" and "c", and 1
> child node called "name" containing "A", I want to return ("A",
> ["a","b","c"]). My current code at
> http://hpaste.org/fastcgi/hpaste.fcgi/view?id=6187#a6187 returns
> [("A","a")("B","b")("C","c")].
>
> Any help is appreciated.
> -deech
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090623/ac29bbf8/attachment.html