I think you want this on the groovy forum, but to help you out.

You are getting the correct behavior.. as the only TEXT inside of the body, is 
aaa.

(it.text())


can could do XmlSlurper(html).html.body.h1[0] to literally go straight to that 
<h1>

Roger

On Jun 14, 2010, at 1:02 PM, Misha Koshelev wrote:

> def html="""
> <html>
> <head>
> </head>
> <body>
> <h1>aaa</h1>
> </body>
> """
> 
> I would like to get text that is _only_ related to h1. However, if I use
> XmlSlurper on the result and do:
> 
> XmlSlurper.depthFirst().find { it.name()=="BODY" }.each { println
> it.text() }
> 
> I still get "AAA" even though it is a _direct_ descendant of H1.
> 
> Thank you!
> Misha
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>    http://xircles.codehaus.org/manage_email
> 
> 


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to