I've the following xml
<ReviseInventoryStatusResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2019-01-02T15:42:31.495Z</Timestamp>
<Ack>Warning</Ack>
<Errors>
<ShortMessage>Requested StartPrice and Quantity revision is redundant.</ShortMessage>
<LongMessage>The existing price and quantity values are identical to those specified in the request and, therefore, have not been modified.</LongMessage>
<ErrorCode>21917091</ErrorCode>
<SeverityCode>Warning</SeverityCode>
<ErrorParameters ParamID="ItemID">
<Value>770386906435</Value>
</ErrorParameters>
<ErrorParameters ParamID="SKU">
<Value/>
</ErrorParameters>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>Requested StartPrice and Quantity revision is redundant.</ShortMessage>
<LongMessage>The existing price and quantity values are identical to those specified in the request and, therefore, have not been modified.</LongMessage>
<ErrorCode>21917091</ErrorCode>
<SeverityCode>Warning</SeverityCode>
<ErrorParameters ParamID="ItemID">
<Value>770386906436</Value>
</ErrorParameters>
<ErrorParameters ParamID="SKU">
<Value/>
</ErrorParameters>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
...
</ReviseInventoryStatusResponse>
I need to get the ShortMessage for the given ItemID that is found in ErrorParameters/Value where ParamID="ItemID"
I've been able to check if a node with the given value exists:
$xmlr = new DOMDocument();
$xmlr->load('ReviseInventoryStatusResponse_error.xml');
$xpath = new DOMXPath($xmlr);
$xpath->registerNamespace('e', 'urn:ebay:apis:eBLBaseComponents');
$nodeExists=($xpath->query('//e:ErrorParameters[@ParamID="ItemID"]/e:Value[. = "770386906435"]')->length>0)?1:0;
then I tried to get its ShortMessage with
$xpath->query('//e:Errors[e:ErrorParameters@ParamID="ItemID"]/e:Value[.="770386906435"]/e:ShortMessage')
but got invalid predicate as expected since not find the right way to combine filters.
can pls suggest the right way?
Thanks