[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

10/29/2009 at 12:15PM PDT, ID: 24855884 | Points: 500
[x]
Attachment Details

XPath expression Problem

Asked by vvsrk76 in XPath, Extensible Markup Language (XML)

Tags: Xpath, XML

I need value of '<BillTOParty>< PartyId>< Id> ' from the XML

<body>    
      <aaia:AddRequestForQuote environment="Test" lang="en" revision="1.2.1">
        <oa:ApplicationArea>
          <oa:Sender>
            <oa:LogicalId>ACONNEX</oa:LogicalId>
            <oa:ReferenceId>084478h7-ce03-9cd0-8f81-f9cb388c654e</oa:ReferenceId>
            <oa:Confirmation>0</oa:Confirmation>
          </oa:Sender>
          <oa:CreationDateTime>2008-04-18T22:54:41Z</oa:CreationDateTime>
          <oa:BODId>084478h7-ce03-9cd0-8f81-f9cb388c654e</oa:BODId>
        </oa:ApplicationArea>
        <oa:DataArea>
          <oa:Add confirm="Always" />
          <oa:RequestForQuote>
            <oa:Header>
              <oa:DocumentIds>
                <oa:CustomerDocumentId>
                  <oa:Id>052570010224040123</oa:Id>
                </oa:CustomerDocumentId>
              </oa:DocumentIds>
              <oa:Parties>
                <oa:BillToParty>
                  <oa:PartyId>
                    <oa:Id>444444</oa:Id>
                  </oa:PartyId>
                  <oa:Name lang="en">Advance Auto Parts</oa:Name>
                  <oa:Addresses>
                    <oa:Address>
                      <oa:AddressLine>P.O. Box 2710</oa:AddressLine>
                      <oa:City>Roanoke</oa:City>
                      <oa:StateOrProvince>VA</oa:StateOrProvince>
                      <oa:Country>US</oa:Country>
                      <oa:PostalCode>24001</oa:PostalCode>
                    </oa:Address>
                  </oa:Addresses>
                </oa:BillToParty>
                <oa:ShipToParty>
                  <oa:PartyId>
                    <oa:Id>5257</oa:Id>
                  </oa:PartyId>
                </oa:ShipToParty>
                <oa:ShipFromParty>
                  <oa:PartyId>
                    <oa:Id>2</oa:Id>
                  </oa:PartyId>
                </oa:ShipFromParty>
              </oa:Parties>
            </oa:Header>
            <oa:Line>
              <oa:LineNumber>1</oa:LineNumber>
              <oa:OrderItem>
                <oa:ItemIds>
                  <oa:CustomerItemId>
                    <oa:Id>01 011</oa:Id>
                  </oa:CustomerItemId>
                </oa:ItemIds>
              </oa:OrderItem>
              <oa:OrderQuantity uom="Each">1</oa:OrderQuantity>
            </oa:Line>
          </oa:RequestForQuote>
        </oa:DataArea>
      </aaia:AddRequestForQuote>    
  </body>

When I use this below XPath, it works fine.
/body/child::*[1]/child::*[1]/DataArea/child::*[2]/Header/Parties/child::*[1]/PartyId/Id/child::*[1]

If I use this below XPath Expression ,it is not  working

body/child::*[1]/child::*[1]/DataArea/child::*[2]/Header/Parties/BillToParty/PartyId/Id/child::*[1]

Please help me in this.Thanks for your time.


 
Loading Advertisement...
 
[+][-]10/29/09 12:47 PM, ID: 25697504

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/29/09 12:49 PM, ID: 25697531

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/29/09 12:58 PM, ID: 25697621

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/29/09 01:00 PM, ID: 25697645

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/29/09 01:04 PM, ID: 25697677

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/29/09 01:09 PM, ID: 25697729

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/29/09 01:15 PM, ID: 25697785

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/29/09 01:16 PM, ID: 25697794

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/29/09 01:25 PM, ID: 25697875

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/29/09 01:36 PM, ID: 25697972

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/29/09 01:39 PM, ID: 25697999

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/29/09 01:59 PM, ID: 25698202

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/29/09 02:05 PM, ID: 25698263

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 - Hierarchy / EE_QW_3_20080625