You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Michael Engelhart <me...@eztrip.com> on 2004/10/13 16:00:09 UTC

xpath multiple namespaces

Hi -

I have a soap envelope that I want to use an XmlCursor with to do a  
cursor.selectPath(query) on and the document has multiple namespaces.    
Is there any sample code anywhere that shows how to use more then one  
namespace in an xpath query?  I can't seem to find an example that  
shows the syntax where there are 2 or more namespaces used in a  
document.

So in the example below I'd like to know how to access a node with  
something like this path:
/SOAP-ENV:Envelope/SOAP-ENV:Header/eb:MessageHeader/eb:From/eb:PartyId

Here's a sample of the XML:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope	xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/ 
envelope/"
					xmlns:eb="http://www.ebxml.org/namespaces/messageHeader"
					xmlns:xlink="http://www.w3.org/1999/xlink"
					xmlns:xsd="http://www.w3.org/1999/XMLSchema">
	<SOAP-ENV:Header>
		<eb:MessageHeader SOAP-ENV:mustUnderstand="1" eb:version="1.0">
			<eb:ConversationId/>
			<eb:From>
				<eb:PartyId type="urn:x12.org:IO5:01">99999</eb:PartyId>
			</eb:From>
			<eb:To>
				<eb:PartyId type="urn:x12.org:IO5:01">123123</eb:PartyId>
			</eb:To>
			<eb:CPAId>IPCC</eb:CPAId>
			<eb:Service eb:type="OXV">SomeService</eb:Service>
			<eb:Action>SomeAction</eb:Action>
			<eb:MessageData>
				<eb:MessageId>mid:20001209-133003-2333@someclient.com</eb:MessageId>
				<eb:Timestamp>2001-02-15T11:15:12Z</eb:Timestamp>
				<eb:TimeToLive>2001-02-15T11:15:12Z</eb:TimeToLive>
			</eb:MessageData>
		</eb:MessageHeader>
		<wsse:Security	xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/ 
secext"
						xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/12/utility">
			<wsse:BinarySecurityToken/>
		</wsse:Security>
	</SOAP-ENV:Header>
	<SOAP-ENV:Body>
		<eb:Manifest SOAP-ENV:mustUnderstand="1" eb:version="1.0">
			<eb:Reference	xmlns:xlink="http://www.w3.org/1999/xlink"
							xlink:href="cid:rootelement"
							xlink:type="simple"/>
		</eb:Manifest>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org