在java

时间:2015-06-09 10:59:52

标签: java xml xpath namespaces

想要在xpaths /SOAP:Envelope/SOAP:Body/generic.GenericObject.configureInstanceWithResult/configInfo/equipment.PhysicalPort/description处获取值 和

/SOAP:Envelope/SOAP:Body/generic.GenericObject.configureInstanceWithResult/deployer

来自以下XML

<?xml version="1.0" encoding="UTF-8"?>
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
     <SOAP:Header>
          <header xmlns="xmlapi_1.0">
               <requestID>XXX</requestID>
          </header>
     </SOAP:Header>
     <SOAP:Body>
          <generic.GenericObject.configureInstanceWithResult xmlns="xmlapi_1.0">
               <deployer>deployer value</deployer>
               <synchronousDeploy>XXX</synchronousDeploy>
               <distinguishedName>XXX</distinguishedName>
               <includeChildren>XXX</includeChildren>
               <configInfo>
                    <equipment.PhysicalPort>
                         <actionMask>
                              <bit>XXX</bit>
                         </actionMask>
                         <administrativeState>XXX</administrativeState>
                         <loadBalanceAlgorithm>XXX</loadBalanceAlgorithm>
                         <description>XXX</description>
                    </equipment.PhysicalPort>
               </configInfo>
          </generic.GenericObject.configureInstanceWithResult>
     </SOAP:Body>
</SOAP:Envelope>

我无法更改Xml或xpath,因此需要提出一个处理它的逻辑。 请告诉我如何处理它。

0 个答案:

没有答案