Solved

Xpath Syntax with attribute urgent

Posted on 2004-10-03
7
237 Views
Last Modified: 2011-10-03
Hi
I have the following xml structure  and want to get the xpath

i know PickUp value and Detailinformation value.
i need xmpath syntax to get Addressess node

I have the following xpath but it is not working

/UPS/Summary/SummaryInformation/PickUp[@value=6481802191]/Detail/Detailinformation[@value=1z3011850343710467]/PackageLevel/Addresses
<Main>
          <Summary>
               <SummaryInformation >
               <PickUpRecord >6481802191</PickUpRecord>
               <PickUp value="6481802191">
               <Detail>
                    <Detailinformation value="1z3011850343710467">
                     <Ref2>1233</Ref2>
                          <PackageLevel>
                               <Addresses>
                                    <Address>
                                        <Type>Sender</Type>
                                        <Floor>2n Floor</Floor>
                                        <SuiteNumber>2200</SuiteNumber>
                                        <City>Atlanta</City>
                                        <State>Ga</State>
                                        <Zip>303319</Zip>
                                        <Country>USA</Country>
                                   </Address>
                                   </Addresses>

                         </PackageLevel>
                </Detail>
                </PickUp>
               <NoOfPackages>78446456464</NoOfPackages>
               </SummaryInformation>
               </Summary>
          <Input>
                   
          </Input>
</Main>
0
Comment
Question by:pprasadravi
  • 2
7 Comments
 
LVL 15

Accepted Solution

by:
dualsoul earned 250 total points
ID: 12213152
/Main/Summary/SummaryInformation/PickUp[@value=6481802191]/Detail/Detailinformation[@value='1z3011850343710467']/PackageLevel/Addresses

you've forgoten quotes, you are compaing strings in Detaliinformation value.
0
 
LVL 7

Expert Comment

by:J_Mak
ID: 12214797
pprasadravi, in your above example you are missing a </Detailinformation> end tag. Just to let you know. And 'UPS' is used instead of 'Main'. Change it to 'Main'. Other than that, I agree with dualsoul's xpath expression. Cheers.
0
 
LVL 15

Expert Comment

by:dualsoul
ID: 12214958
i think the XML was changed a bit, before posting here due to confidential issues.
0
 

Author Comment

by:pprasadravi
ID: 12217143
issue resolved
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question