Need to retrieve the attributes of nodes in XML using Xpath
Hi everyone, i have xml input. I need to retrieve all the attributes of the specific node .thanks in advance
Hi everyone, i have xml input. I need to retrieve all the attributes of the specific node .thanks in advance
Whenever I need to parse XML, I use the built-in E4X framework to access what I need.
For example, if I need to retrieve the name attribute, I use this syntax:
result = result_XML.*::["XMI.content"].UML::Model[0].@name
There are various other accessors,all described here: https://svn.wso2.org/repos/wso2/tags/carbon/0.1alpha/mashup/java/xdocs/e4xquickstart.html
I always use this approach because I do not like to depend on other extensions, especially when there is a built-in capability in the platform to do that.
The E4X framework is not exactly something extremely easy to understand, but also not a huge task - hence I suggest trying this.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.