Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xpath 使用多个谓词和多个谓词进行提取_Xpath - Fatal编程技术网

Xpath 使用多个谓词和多个谓词进行提取

Xpath 使用多个谓词和多个谓词进行提取,xpath,Xpath,我想从jms总线节点提取信息。特别是巴士公司, //[local-name()='jms-bus'][@busid=/[local-name()='jms-listener']/@busidref]/@busid完全匹配,如果具有匹配的提供程序和服务,则返回quickstartGwChannel和QuickStartSBChannel 但是,我想返回jms总线,其中有一个jms侦听器,即gateway='true' 我不知道把“和”条款放在哪里。当我把它放在开头时/*[local-name()=

我想从jms总线节点提取信息。特别是巴士公司, //[local-name()='jms-bus'][@busid=/[local-name()='jms-listener']/@busidref]/@busid完全匹配,如果具有匹配的提供程序和服务,则返回quickstartGwChannel和QuickStartSBChannel

但是,我想返回jms总线,其中有一个jms侦听器,即gateway='true'

我不知道把“和”条款放在哪里。当我把它放在开头时/*[local-name()='jms-listener]/[@is gateway='true']和。。。。它返回一个布尔值

我需要从这个xml中提取

<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="X12"
                          is-gateway="false"
            />
        </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>
                <!-- The next action is for Continuous Integration testing -->
                <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
        </actions>
    </service>
  </services>

类似这样的内容:

//*[local-name()='jms-bus']
   [@busid=//*[local-name()='jms-listener']
              [@is-gateway='true']/@busidref]/@busid


你想要什么信息请列下来。你是不可理解的。。
//*[local-name()='jms-bus']
   [@busid=//*[local-name()='jms-listener' and @is-gateway='true']/@busidref]/@busid