cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Need to retrieve the attributes of nodes in XML using Xpath

KT_10107318
7-Bedrock

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 

ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

2 REPLIES 2

Hello @KT_10107318 

 

Pls check the attached article and let me know if it works for you:

https://www.ptc.com/en/support/article/cs308188

 

Regards

Bhawna

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.

Announcements


Top Tags