Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WSO2 using xpath to get element inside a xml-content property

I have got an local entry in wso2 esb which contains an xml structure. I succeed in loading it into a property, but fail to perform xpath sentences over it for looking for a node value.

How could I do this?

like image 289
fipries Avatar asked Jan 24 '26 20:01

fipries


1 Answers

The elements in a XML file(this can be in a local entry , registry or even as a property) can be accessed using property mediator function. Following sample configuration shows how to get the value of the node 'b' in test.xml file in the local config repository.

ie:- test.xml --> <a>Helloo<b>World</b></a>

<property name="test" expression="get-property('registry','conf:/test.xml')" scope="default" type="OM"/>
<log level="custom">
      <property name="test.b" expression="$ctx:test//b"/>
</log>
like image 198
CharithaM Avatar answered Jan 27 '26 15:01

CharithaM



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!