[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Basic question about Namespace handling in XPath 1.0 (

Subject: Basic question about Namespace handling in XPath 1.0 (not necessarily related to XSLT)
From: Prakash <prakash.subramaniam@xxxxxxxxxx>
Date: Wed, 28 Sep 2005 19:17:09 +0530
xpath 1.0 namespace
Hi All,

While going thro' the XPath 1.0 spec's LocationPath, I was wondering how the node selection is handled when the nodes are in their own namespaces. To explain in detail,

Let us take the following Xml example:

<?xml version="1.0">
<customers *xmlns*="http://www.customers.com">
  <customer *xmlns:sup*="http://www.suppliers.com">
      <*sup:name>*sgd</sup:name>
      <*sup:*pwd>hello</sup:pwd>
      <*sup:*details>
          *<order xmlns:sup*="http://www.anothersupplier.com" *xmlns=""*>
               <*sup:name>*sr</sup:name>
          </order>
      </sup:details>
      <customerName>pr</customerName>
      *<order/>*
  </customer>
</customers>

So, two questions in this:

1. If we have a XPath like "//sup:name", how will the XPath processor know which "sup:name" will have to be returned? (considering that there are two sup:name elements that are in two different namespaces.
2. Similarly, if we have a XPath such as "//order", which "order" will be considered considering that there are two order elements both in default namespace (first order element is actually in null namespace whereas the second one in default namespace declared in the root element)


Thanks,
Prakash

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.