Solved

Xpath Syntax with attribute urgent

Posted on 2004-10-03
7
231 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now