Solved

Xpath Syntax with attribute urgent

Posted on 2004-10-03
7
248 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
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, …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 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