Solved

Xpath Syntax with attribute urgent

Posted on 2004-10-03
7
220 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
Comment Utility
/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
Comment Utility
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
Comment Utility
i think the XML was changed a bit, before posting here due to confidential issues.
0
 

Author Comment

by:pprasadravi
Comment Utility
issue resolved
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

12 Experts available now in Live!

Get 1:1 Help Now