Interview Questions

XML nodes -- Count nodes


(Continued from previous question...)

XML nodes -- Count nodes

Use the GroovyUtils class to create an XmlHolder, which you can use for a variety of XML related activities:

1.// create groovyUtils and XmlHolder for response of Request 1 request
2.def groovyUtils = new context )
3.def holder = groovyUtils.getXmlHolder( "Request 1#Response" )
5.def numberOfLinksInParagraphs = holder["count(//html/body/p/a)"]

(Continued on next question...)

Other Interview Questions