[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Attributes, attribute nodes & namespaces

Subject: Re: Attributes, attribute nodes & namespaces
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Wed, 4 Jul 2001 09:55:30 +0100
Re:  Attributes
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


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.