cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: R:R:pathargs problem
Date Fri, 03 Mar 2000 18:27:39 GMT
Scott_Boag@lotus.com wrote:
> 
> We've come to the conclusion that Xalan is doing 100% the right thing by
> throwing an error for xsl:version on an xsl:stylesheet element.
> 
> The recommendation says: "An element from the XSLT namespace may have any
> attribute not from the XSLT namespace, provided that the expanded-name of
> the attribute has a non-null namespace URI."  Note the "not from the XSLT
> namespace".

I believe you are wrong. 

Quoting the specification above:

"An element from the XSLT namespace _may_ have any attribute _NOT_ from
the XSLT namespace, provided that the expanded-name of the attribute has
_non-null_ namespace URI."

A few cases (excuse the stupid namespace declaration):

1) <foo:stylesheet version="1.0" xmlns:foo="xslt"/>
2) <stylesheet version="1.0" foo:whatever="" xmlns="xslt"
xmlns:foo="whatever"/>
3) <xsl:stylesheet xsl:version="1.0" whatever="" xmlns:xsl="xslt"
xmlns="whatever"/>
4) <xsl:stylesheet xsl:version="1.0" foo:whatever="" xmlns:xsl="xslt"
xmlns:foo="whatever"/>

1) is legal, we all agree on that.
2) is legal, because it contains an attribute which expanded-name has a
non-null namespace URI
3) is legal, because it contains an attribute (whatever) that has a
non-null namespace URI ("whatever:whatever" is the full name)
4) is legal, because the above quote doesn't say anything about this. Of
course, this is the normal namespace behavior. It talks about attributes
from "other" namespaces. It is implied that the attributes of the
current namespaces _MUST_ be considered valid.

The above quote is only works for something like this

5) <xsl:stylesheet version="1.0" whatever="" xmlns:xsl="xslt"/>

which is ILLEGAL!!! because whatever expands to a NULL namespace and
it's not covered XSLT DTD.

Note, however, that something like this is LEGAL

<xsl:stylesheet xsl:version="1.0" whatever="" xmlns="whatever"
xmlns:xsl="xslt"/>

while something like this is NOT

<xsl:stylesheet version="1.0" whatever="" xmlns="whatever"
xmlns:xsl="xslt"/>

because version is part of the "whatever" namespace and you must be
_FORCED_ to apply the "xsl" prefix up front.

Something like this

<xsl:stylesheet xsl:version="1.0" version="1.0" whatever=""
xmlns="whatever" xmlns:xsl="xslt"/>

implies that both "whatever" and "xslt" namespace have the version "1.0"
and it's perfectly legal.

> I could be misinterpreting this passage.  If someone disagrees with this
> interpretation, please let me know.  But for now, I think Xalan is doing
> the right thing, and will leave things as they are.  (Note that foo:version
> will not cause an error to be thrown, providing foo binds to a non XSLT
> namespace).

You guys should _NOT_ think about namespace prefixes but about real
namespaces: their expanded values. Only in that case the things clear
out.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message