I am working with an API that returns groovy.util.Node, allowing me to customize its generated XML. I need to add a child to Node, and I am wondering if I can use MarkupBuilder syntax to change Node.
For example, something works here, but it seems klunky:
withXml { rootNode ->
def appendedNode = new Node(rootNode, 'foo', [name:'bar'])
def appendedNodeChild = new Node(appendedNode, 'child', [blah:'baz'])
}
Is there a way to add MarkupBuilder-ish syntax to rootNode? Thank.
source
share