[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: how to read attribute if defined as <namespace>:<a
> > However, this is not guaranteed to work because > XSL isn't obligated to preserve prefix names (though it > usually will). It's only obligated to make sure the right > namespace-URIs continue to be associated with the right > nodes. (Someone please correct me if that's inaccurate.) It's inaccurate. The namespace nodes in the data model hold a prefix and URI. Operations on namespace nodes are therefore prefix-preserving. But element and attribute nodes don't hold a namespace prefix, they only hold a namespace URI. This means, for example, that if you use the name() function on an element, it's (in theory) unpredictable what the prefix will be, but whatever the prefix is, you can find out what URI it relates to by looking for that prefix in the namespace nodes. In practice, prefixes returned by name() (or generated in output by the serializer) are predictable except in unusual cases, for example (a) if two prefixes have been declared for the same URI, or (b) if the same prefix has been used for two different URIs. Michael Kay 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
|