Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] GPathResult find() method help

Gordon Ross

2010-03-11

Replies: Find Java Web Hosting

Author LoginPost Reply
I'm trying to use the find() method of GPathResult, but I'm not finding
anything. I can't seem to find any good documentation on how to use the find
method call. Below is what I'm trying to do. Can someone tell me what I'm
doing wrong, as it prints nothing, rather than the Txn node I'm expecting to
find.

Thanks,

GTG

String s = "<Msg><Txn>fwdsmsreceipt</Txn><JobId>1234</JobId></Msg>";
def msgBody = new XmlSlurper().parseText(s);
def r = msgBody.find { it.name().equalsIgnoreCase("Txn") }
println(r);

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

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.