0
xmlnodelist
のを得る方法正確に2つのOriginDestinationOption
を持っています。正確に2つのOriginDestinationOptionを持つOriginDestinationOptionsのxmlnodelistを得る方法
//ns1:OriginDestinationOptions[count(ns1:OriginDestinationOption)=2]
の目的で使用する方(XmlNamespaceManager
にプレフィックスns1
を登録することを確認しますとSelectNodes()
またはSelectSingleNode()
に名前空間マネージャに合格することを忘れないでください:XPathは以下のようになり
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<OTA_AirPriceRS xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:ns1="http://www.opentravel.org/OTA/2003/05">
<ns1:PricedItinerary ApplyMarkup="Y" FareType="Refundable" LFSPRICEDIFF="0" MatrixFare="" OriginDestinationRPH="DELBOMG8346G820160520BOMDELG8329G820160522" OriginDestinationRefNumber="2" ReturnOnly="true" SequenceNumber="" SupplierSystem="G8CP" isTBF="false">
<ns1:AirItinerary FareType="Refundable" SupplierCode="G8CP" SupplierSystem="G8CP" TripType="" UniqueIdentifier="1">
<ns1:OriginDestinationOptions WorkFlow="PFB">
<ns1:OriginDestinationOption>
</ns1:OriginDestinationOption>
<ns1:OriginDestinationOption>
</ns1:OriginDestinationOption>
</ns1:AirItinerary>
</OTA_AirPriceRS>
</soapenv:Body>
</soapenv:Envelope>
2つの子ノード「xyz」を持つすべての「abc」ノードを選択したいとします。子ノードの発生は2以下であり、2以上である。 – user1799669