[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Are namespace nodes required in XSLT 2.0?


Subject: RE: [xsl] Are namespace nodes required in XSLT 2.0?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 21 Dec 2006 18:30:02 -0000

>   I always thought namespace nodes were required in XSLT 2.0 
> (despite they are optional in XPath 2.0 and namespace axis is 
> deprecated).

<xsl:namespace> creates a namespace node. The construct isn't optional, and
its semantics are well-defined. It can't be defined in terms of "adding an
in-scope namespace to the tree", because it's an expression and an
expression has to return a result, and that result is a namespace node. You
can test whether it's a node, and the answer is true; you can test whether
it's any of the other kinds of node, and the answer in each case is false.

XQuery is facing the requirement to add some capability for dynamic creation
of namespaces. It's also struggling with defining how namespaces behave in
the update facility. I think it's going to be a real struggle to do that
without introducing namespace nodes.

I'm rather disappointed that XPath ended up describing the namespace axis as
deprecated. As far as I'm concerned, given that XML namespaces themselves
are an abominably bad piece of design, the "namespace node" concept is the
cleanest way of modelling them that I have seen.

Michael Kay
http://www.saxonica.com/


Current Thread
Keywords