Hi,
I am working with some XML, not really technically inclined and been trying to figure this out from reading various sources on the internet but getting nowhere fast.
I have the below XML:
Code:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<XXXSoapHeader xmlns="http://XXX.com/optima/webservices">
<AuthenticationString>?</AuthenticationString>
</XXXSoapHeader>
</soap:Header>
<soap:Body>
<SubmitMultipleCalcMarginRequestResponse xmlns="http://XXX.com/optima/webservices">
<SubmitMultipleCalcMarginRequestResult>
<TaskExecutionSubmitInfo>
<taskExecutionId>74457</taskExecutionId>
<description>Calc LIVE BROKER margin : Account WebServiceTest_Account1(435) : Business Date (12-Feb-2007)</description>
</TaskExecutionSubmitInfo>
<TaskExecutionSubmitInfo>
<taskExecutionId>74458</taskExecutionId>
<description>Calc LIVE BROKER margin : Account WebServiceTest_Account2(436) : Business Date (12-Feb-2007)</description>
</TaskExecutionSubmitInfo>
</SubmitMultipleCalcMarginRequestResult>
</SubmitMultipleCalcMarginRequestResponse>
</soap:Body>
</soap:Envelope>
And have been using the below to extract nodes:
Code:
//*[name() = 'taskExecutionId']
Which returns:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://XXX.com/optima/webservices">
<taskExecutionId>74457</taskExecutionId>
<taskExecutionId>74458</taskExecutionId>
</root>
But what can I do if I want to return just the second taskExecutionId? I have tried appending with a [n] but this doesn't to work. Any ideas?