[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Attributes, attribute nodes & namespaces
Hi Andrew, > If an attribute node can have a QName and an expanded-name why does > (or so it seems to me) an XPath attribute node not have a namespace > node to correspond to the namespace? First, remember that namespace nodes aren't about what the namespace of a particular element or attribute is, but rather about what namespaces are in scope on a particular element. Getting the namespace of an element or attribute can be done with the namespace-uri() function. Now, the only thing that changes whether a namespace is in scope is if you have a namespace declaration on an element. You cannot have a namespace that is only in scope for a particular attribute. So the namespace nodes for an attribute must be exactly the same as the namespace nodes for its parent element. Given that, why bother storing all that extra information about the namespaces that are available on an attribute? The only cost of not doing so is that the location path to get the namespaces that are in scope for an attribute are three characters longer: ../namespace::* rather than: namespace::* What benefit would you get from having namespace nodes on attributes too? Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ 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
|