Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-17-2013, 02:35 PM   PM User | #1
AdiCF123
New to the CF scene

 
Join Date: Jan 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
AdiCF123 is an unknown quantity at this point
XML, Soap and XPATH

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?
AdiCF123 is offline   Reply With Quote
Old 01-18-2013, 02:26 PM   PM User | #2
AdiCF123
New to the CF scene

 
Join Date: Jan 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
AdiCF123 is an unknown quantity at this point
I got a response on Stack Overflow if anybody is every interested:

http://stackoverflow.com/questions/1...98125#14398125
AdiCF123 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:15 AM.


Advertisement
Log in to turn off these ads.