<ns2:createOrder>
<ns2:serviceResponseContext >
<interactionId></interactionId>
<requestId>5</requestId>
<requestReceivedTimestamp>Mon Jul 15 10:06:45 MDT
</requestReceivedTimestamp>
<responseGeneratedTimestamp>Mon Jul 15 10:07:29 MDT </responseGeneratedTimestamp>
<serverHostPort></serverHostPort>
<serviceDuration>44541</serviceDuration>
<statusCode>0</statusCode>
</ns2:serviceResponseContext>
<ns2:createOrderResponse>
<ns2:statusLog>
<ns2:createOrderStep>PROVISION_CODE</ns2:createOrderStep>
<ns2:statusCode>0</ns2:statusCode>
<ns2:message></ns2:message>
</ns2:statusLog>
<ns2:statusLog>
<ns2:createOrderStep>VISION_CODE</ns2:createOrderStep>
<ns2:statusCode>0</ns2:statusCode>
<ns2:message></ns2:message>
</ns2:statusLog>
我需要仅在statusCode = 0时从XML文件中提取第一个<statusCode>
<statusCode>
应使用常规表达式在<createOrder>
内。
我只需要第一个<statusCode>0<statusCode>
并忽略<createOrderStep>
感谢您的帮助!!
答案 0 :(得分:0)
尝试以下方法适用于
<statusCode>0</statusCode> and <ns2:statusCode>0</ns2:statusCode>
/<(ns2:)?statusCode>0<\/(ns2:)?statusCode>/