Вопрос

I have an Xml tag <com:Id>33638</com:Id> I want to read the value 33638 from the tag, I have parsed the xml string and stored to another string variable but cant read the value using

String id  = 'com:Id'.text();
Это было полезно?

Решение

This works fine:

def t = "<com:Id>33638</com:Id>"
def xml = new XmlParser(false, false).parseText(t)
println xml.text()
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top