def message = """ <hello> <world> WOW </world> <world a="wow_attr"> WOW2 </world> <my> <ngrinder> GOOD!! </ngrinder> </my> </hello>""" def hello = new XmlParser().parseText(message); grinder.logger.info(hello.world[1].text()) grinder.logger.info(hello.world[1].'@a')原文链接:https://www.f2er.com/xml/294895.html