|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








