[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

Subject: RE: how to read attribute if defined as <namespace>:<attname>
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 15 Jul 2003 15:42:46 +0100
if defined
> 
> 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


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.