xml - Returning nodeset based on two other nodes being equal -
i trying return specific nodeset based on value of 1 node = node.
the expression //*[local-name()='jms-listener']/@busidref=//*[local-name()='jms-bus']/@busid
returns boolean from
<providers> <jms-provider name="jbossmq" connection-factory="connectionfactory"> <jms-bus busid="quickstartgwchannel"> <jms-message-filter dest-type="queue" dest-name="queue/quickstart_helloworld_request_gw" /> </jms-bus> <jms-bus busid="quickstartesbchannel"> <jms-message-filter dest-type="queue" dest-name="queue/quickstart_helloworld_request_esb" /> </jms-bus> </jms-provider> </providers> <services> <service category="firstserviceesb" name="simplelistener" description="hello world"> <listeners> <jms-listener name="jms-gateway" busidref="quickstartgwchannel" is-gateway="true" /> <jms-listener name="helloworld" busidref="quickstartesbchannel" /> </listeners> <actions mep="oneway"> <action name="action1" class="org.jboss.soa.esb.samples.quickstart.helloworld.myjmslisteneraction" process="displaymessage" /> <action name="action2" class="org.jboss.soa.esb.actions.systemprintln"> <property name="printfull" value="false"/> </action> <!-- next action continuous integration testing --> <action name="teststore" class="org.jboss.soa.esb.actions.testmessagestore"/> </actions> </service> </services>
i need return quickstartgwchannel.
the conditional check needs property of node. try this:
//jms-listener[@busidref=//jms-bus/@busid]/@busidref
which returns:
quickstartgwchannel quickstartesbchannel
the xpath saying find jms-listener
node @busidref
attribute equal jms-bus
node's @busid
attribute. return @busidref
attribute values of nodes.
if need use local-name
, above xpath be:
//*[local-name()='jms-listener'][@busidref=//*[local-name()='jms-bus']/@busid]/@busidref
if want check is-gateway attribute true, add list of predicates:
//*[local-name()='jms-listener'][@busidref=//*[local-name()='jms-bus']/@busid][@is-gateway='true']/@busidref
Comments
Post a Comment