This would work as well, but is slower
body/child::*[1]/child::*[
local-name() tests for the namespace independent name of the element
Main Topics
Browse All TopicsI 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:
<oa:ReferenceId>084478h7-c
<oa:Confirmation>0</oa:Con
</oa:Sender>
<oa:CreationDateTime>2008-
<oa:BODId>084478h7-ce03-9c
</oa:ApplicationArea>
<oa:DataArea>
<oa:Add confirm="Always" />
<oa:RequestForQuote>
<oa:Header>
<oa:DocumentIds>
<oa:CustomerDocumentId>
<oa:Id>052570010224040123<
</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
<oa:Country>US</oa:Country
<oa:PostalCode>24001</oa:P
</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:LineN
<oa:OrderItem>
<oa:ItemIds>
<oa:CustomerItemId>
<oa:Id>01 011</oa:Id>
</oa:CustomerItemId>
</oa:ItemIds>
</oa:OrderItem>
<oa:OrderQuantity uom="Each">1</oa:OrderQuan
</oa:Line>
</oa:RequestForQuote>
</oa:DataArea>
</aaia:AddRequestForQuote>
</body>
When I use this below XPath, it works fine.
/body/child::*[1]/child::*
If I use this below XPath Expression ,it is not working
body/child::*[1]/child::*[
Please help me in this.Thanks for your time.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thanks for reply.
I am using IBM WID.In xml we have namespace declartion.
<aaia:AddRequestForQuote environment="Test" lang="en" revision="1.2.1"
xmlns:oa="http://www.opena
xmlns:aaia="http://www.aft
I used below xpath expression, stiill itis not working
body/child::*[1]/child::*[
well I based tha XPath on your claim in your original question that this one is working
/body/child::*[1]/child::*
Now, when I look back at your XML, I think that claim is false.
This XPath can't possibly work
If you want to translate that into an XPath using local-name(), this is what you would get
/body/child::*[1]/child::*
This is XML Request
<?xml version="1.0" encoding="UTF-8"?>
<aaia:AddRequestForQuote
xmlns:xs = "http://www.w3.org/2001/XM
xmlns:oa = "http://www.openapplicatio
xmlns:aaia = "http://www.aftermarket.or
<oa:ApplicationArea>
<oa:Sender>
<oa:LogicalId>ACONNEX</oa:Log
<oa:ReferenceId>8d3369a0-41e
<oa:Confirmation>0</oa:Confir
</oa:Sender>
<oa:CreationDateTime>2009-10
<oa:BODId>8d3369a0-41e2-9f9d
</oa:ApplicationArea>
<oa:DataArea>
<oa:Add confirm = "Always"/>
<oa:RequestForQuote>
<aaia:Header>
<oa:DocumentIds>
<oa:CustomerDocumentId>
<oa:Id>none</oa:Id>
</oa:CustomerDocumentId>
</oa:DocumentIds>
<oa:DocumentDateTime>2009-10
<oa:DropShipInd>0</oa:DropShi
<oa:BackOrderedInd>0</oa:Back
<oa:ReasonCode>Stocking</oa:R
<oa:Parties>
<oa:BillToParty>
<oa:PartyId>
<oa:Id>444444</oa:Id>
</oa:PartyId>
<oa:Name>SPEED ECAT TEST-A</oa:Name>
<oa:Addresses>
<oa:Address>
<oa:AddressLine>DEMO</oa:Addr
<oa:City>TOMS RIVER</oa:City>
<oa:Country>US</oa:Country>
<oa:StateOrProvince>NJ</oa:St
<oa:PostalCode>08753</oa:Post
</oa:Address>
</oa:Addresses>
</oa:BillToParty>
<oa:ShipToParty>
<oa:PartyId>
<oa:Id>444444</oa:Id>
</oa:PartyId>
<oa:Name>SPEED ECAT TEST-A</oa:Name>
<oa:Addresses>
<oa:Address>
<oa:AddressLine>DEMO</oa:Addr
<oa:City>TOMS RIVER</oa:City>
<oa:Country>US</oa:Country>
<oa:StateOrProvince>NJ</oa:St
<oa:PostalCode>08753</oa:Post
</oa:Address>
</oa:Addresses>
</oa:ShipToParty>
<oa:ShipFromParty>
<oa:PartyId>
<oa:Id>1</oa:Id>
</oa:PartyId>
</oa:ShipFromParty>
<aaia:HostParty>
<oa:PartyId>
<oa:Id>6036530000180910</oa:I
</oa:PartyId>
</aaia:HostParty>
</oa:Parties>
</aaia:Header>
<aaia:Line>
<oa:LineNumber>001</oa:LineNu
<aaia:OrderItem>
<aaia:ItemIds>
<oa:CustomerItemId>
<oa:Id>01011</oa:Id>
</oa:CustomerItemId>
<aaia:SupplierCode>ABC</aaia:
</aaia:ItemIds>
</aaia:OrderItem>
<oa:OrderQuantity uom = "EA">1</oa:OrderQuantity>
<oa:UserArea>
<oa:CarrierParty>
<oa:PartyId>
<oa:SCAC/>
</oa:PartyId>
</oa:CarrierParty>
</oa:UserArea>
<aaia:Vehicle>
<aaia:Year>2005</aaia:Year>
<aaia:Make>FORD</aaia:Make>
<aaia:Model>CROWN VICTORIA</aaia:Model>
<aaia:Engine>V8 4.6L 281ci GAS FI vin: W USA</aaia:Engine>
</aaia:Vehicle>
</aaia:Line>
</oa:RequestForQuote>
</oa:DataArea>
</aaia:AddRequestForQuote>
This XPath will work,
/*[local-name() = 'AddRequestForQuote']/*[lo
I have tested that with your full XML
I am looking into the WID thing you describe... a bit of code would help though,
I assume you put the XPath in a java call?
In coming req may 'purcahse orders' type or 'shipment 'type or 'quote'.
We need to use common filter.
Please check this IBM link
http://www-01.ibm.com/supp
ID:25698202 will work on the data given.
The original poster never succeeded in showing code that would help me to improve performance on this XPath.
The original poster also did not say that this XPath is not working (it does in my test harnass on his data)
I recommend to accept the above answer
By the way I indicated that the namespace was an issue right from th estart
I object to deletion
ID:25698202 will work on the data given.
The original poster never succeeded in showing code that would help me to improve performance on this XPath.
The original poster also did not say that this XPath is not working (it does in my test harnass on his data)
I recommend to accept the above answer
By the way I indicated that the namespace was an issue right from th estart
I object to deletion
Business Accounts
Answer for Membership
by: GertonePosted on 2009-10-29 at 12:47:43ID: 25697504
note that BillToParty is in a namespace
oa:BillToParty
somewhere (not in your example) in the XML there is a xmlns:oa="..."
note that this is not simply BillToParty, but BillToParty in thsi specific namespace
you have to reflect that in the XPath addressing
using oa:BillToParty instead of BillToParty in your path will work,
on the condition that you could bind "oa:" as a prefix to that namespace, as in the original document
In XSLT that is simply adding the namespace binding to the stylesheet element.
In most dom like programming, you would need a namespacemanager.
How do you execute the XPath?