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

Re: XPath attribute namespace

Subject: Re: XPath attribute namespace
From: Oliver Becker <obecker@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 8 Aug 2001 09:31:07 +0200 (MEST)
xpath attribute namespace
Hi David,

> I don't understand why the XPath spec says:
> 
> "the namespace axis contains the namespace nodes of the context node; the 
> axis will be empty unless the context node is an element"
> 
> How do you get to the namespace for an attribute node? For example 
> <url xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="www.xxx.com">.
> It seems like the namespace in this case is associated with the attribute
> and not the element. How should I interpret this?

Every element and every attribute has a qualified name. This is a name
composed of a local name and a namespace. And of course, there is only
one namespace per name. 
On the other hand all namespaces are associated with prefixes. This allows
you writing xlink:href, because xlink refers to a namespace. The set
of associations between prefixes and namespaces establishes a set of
namespace nodes. These belong per definition to an element node.

So don't be confused. The namespace axis allows you to retrieve all
namespaces that are "in scope" for that element. The namespace-uri function,
as Dimitre already pointed out, tells you the namespace the node belongs
to.

Hope that helps,
Oliver


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.