需要在下面的xml中获取标签的xpath

时间:2018-07-27 00:20:21

标签: xml xpath jmeter extractor

<?xml version="1.0" encoding="UTF-8"?>
<OutputParameters xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/sp/SearchBPDBService" xmlns:jca="http://xmlns.oracle.com/pcbpel/wsdl/jca/" xmlns:ns0="http://xmlns.oracle.com/Service" xmlns:plt="http://schemas.xmlsoap.org/link/" xmlns:tns="http://xmlns.oracle.com/Service" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
   <ns0:X_B_P_INFO>
      <ns0:X_B_P_INFO_ITEM>
         <ns0:P_ID>147392640</ns0:P_ID>
         <ns0:F_ID>213910194</ns0:F_ID>
         <ns0:STATUS />
         <ns0:OS>
            <ns0:OS_ITEM>
               <ns0:O_P_ID>378602</ns0:O_P_ID>
               <ns0:F_ID>2937983</ns0:F_ID>
               <ns0:N_ID>614000751</ns0:N_ID>
               <ns0:O_MSET>
                  <ns0:O_MSET_ITEM>
                     <ns0:MSET>O-B-C1</ns0:MSET>
                     <ns0:PRIMARY_FLAG>true</ns0:PRIMARY_FLAG>
                  </ns0:O_MSET_ITEM>
               </ns0:O_MSET>
               <ns0:AgS>
                  <ns0:AgS_ITEM>
                     <ns0:Ag_P_ID>2088905</ns0:Ag_P_ID>
                     <ns0:F_ID>213910197</ns0:F_ID>
                     <ns0:NAR_ID>614005892</ns0:NAR_ID>
                     <ns0:Ag_MSET>
                        <ns0:Ag_MSET_ITEM>
                           <ns0:MSET>A-BCNJ-12091</ns0:MSET>
                           <ns0:PRIMARY_FLAG>true</ns0:PRIMARY_FLAG>
                        </ns0:Ag_MSET_ITEM>
                     </ns0:Ag_MSET>
                  </ns0:AgS_ITEM>
               </ns0:AgS>
            </ns0:OS_ITEM>
         </ns0:OS>
      </ns0:X_B_P_INFO_ITEM>
   </ns0:X_B_P_INFO>
</OutputParameters>

尝试以下两种方法。 例如1 // ns0:X_B_P_INFO / ns0:X_B_P_INFO_ITEM / ns0:P_ID

// ns0:X_B_P_INFO / ns0:X_B_P_INFO_ITEM / ns0:P_ID / ns0:OS / ns0:OS_ITEM / ns0:O_P_ID

// OutputParameters / [@ ns0 ='X_B_P_INFO'/ [@ ns0 ='X_B_P_INFO_ITEM'/ [@ ns0 ='P_ID'] / text()

// OutputParameters / ns0:X_B_P_INFO / ns0:X_B_P_INFO_ITEM / ns0:OFFICE_PARTY_ID / *

例如2 // * [@@ id =“ collapsible0”] / div [1] / div [1] / span [2]

如果这是重复的话,我事先表示歉意,但是对此深感困惑,谢谢。

0 个答案:

没有答案