Subject: Re: [xsl] XPath attribute namespace From: Oliver Becker <obecker@xxxxxxxxxxxxxxxxxxxxxxx> Date: Wed, 8 Aug 2001 09:31:07 +0200 (MEST) |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] XPath attribute namespace, Michael Kay | Thread | [xsl] Re: XPath attribute namespace, Dimitre Novatchev |
RE: [xsl] TransformerException, Tim Watts | Date | Re: [xsl] Problem with Chinese (Sol, Michael Beddow |
Month |