1
votes

in wso2 I've an xml as a local property containing a list of status with code and description (status_list). I would like to select the correct status for one given code. This code is stored in a property. I've tried something like

<property name="codes" expression="get-property('status_list')" scope="default" type="OM"/>
<log level="custom">
    <property expression="$ctx:codes/status[@code='$ctx:code']" name="Test"/>
</log> 

$ctx:codes/status is ok and display the list of all status but as soon as I want to "filter" them it's not working. Of courise if I hardcode a code the xpath is working.

<property expression="$ctx:codes/status[@code='code1']" name="Test"/>

Do you have an idea how to achieve this?

1

1 Answers

2
votes

Ok finally I was not so far away from the response. The following code is working

<property name="codes" expression="get-property('status_list')" scope="default" type="OM"/>
<log level="custom">
    <property expression="$ctx:codes/status[@code=$ctx:code]" name="Test"/>
</log> 

I simply had to remove the quotes...