I'm trying to use eBaysvc.xsd not only to validate an xml but to build the xml itself:
therefore, passing as $API
AddDispute
I want to retrieve something like this xml:
<?xml version="1.0" encoding="utf-8"?>
<AddDisputeRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<DisputeExplanation> Tokens </DisputeExplanation>
<DisputeReason> Tokens </DisputeReason>
<ItemID> string </ItemID>
<TransactionID> string </TransactionID>
<OrderLineItemID> string </OrderLineItemID>
<Version> string </Version>
<RequesterCredentials>
<eBayAuthToken> string </eBayAuthToken>
</RequesterCredentials>
<WarningLevel> Tokens </WarningLevel>
</AddDisputeRequest>
I built a script using xpath->query that should filter elements according to multiple parameters and so far I got this:
$Nodes = $xpath->query('//xs:element[(xs:annotation/xs:appinfo/ebl:CallInfo/ebl:CallName/text()="'.$API.'" or xs:annotation/xs:appinfo/ebl:CallInfo/ebl:AllCalls) and (xs:annotation/xs:appinfo/ebl:CallInfo/ebl:RequiredInput/text()="Yes" or xs:annotation/xs:appinfo/ebl:CallInfo/ebl:RequiredInput/text()="Conditionally")]')
but I need to add a further parameter, that is related not to the element but to his Ancestor:
assuming element with name="ItemID"
we need to add to the query something like
and element:parent:parent:parent:parent[@name="'.$API.'Type"]
since we have this definition:
<xs:complexType name="AddDisputeRequestType">
<xs:annotation>
<xs:documentation>
Enables a buyer and seller in an order relationship to
send messages to each other's My Messages Inboxes.
</xs:documentation>
<xs:appinfo>
<RelatedCalls>
AddMemberMessagesAAQToBidder, AddMemberMessageRTQ
</RelatedCalls>
</xs:appinfo>
</xs:annotation>
<xs:complexContent>
<xs:extension base="ns:AbstractRequestType">
<xs:sequence>
<xs:element name="ItemID" type="ns:ItemIDType" minOccurs="0">
...
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
but have no idea how to achieve this: can somebody suggest the solution
PS: is there an easier way to check for "Yes|Conditionally" in RequiredInput