Forum Discussion

MartinSpamer's avatar
MartinSpamer
Frequent Contributor
13 years ago

XmlSlurper is foobar

According to the documentation for xmlSlurper the following should work.


def FOO_BAR_XML = """
<a>
<b>
<c>
<d>result!<x/><y/><z/></d>
</c>
</b>
</a>
"""

def foo = new XmlSlurper().parseText( FOO_BAR_XML )
log.info foo."a.b.c.d".text()
log.info foo."*.d".text()
assert "result" == foo."a.b.c.d".text() , foo."a.b.c.d".text()
assert "result" == foo."*".text() , foo."*.d".text()


1) .text() always returns an empty String.
2) ."*" (and "**") always fails.
No RepliesBe the first to reply