cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timm, Sean" <ST...@mailgo.com>
Subject RE: R:R:pathargs problem
Date Fri, 03 Mar 2000 23:06:03 GMT
I believe you are wrong about Scott being wrong. :)

The following is a quote from section 2.3 of the spec:
------------------------------------------------------
<html xsl:version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns="http://www.w3.org/TR/xhtml1/strict">
  <head>
    <title>Expense Report Summary</title>
  </head>
  <body>
    <p>Total Amount: <xsl:value-of select="expense-report/total"/></p>
  </body>
</html>
has the same meaning as

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://www.w3.org/TR/xhtml1/strict">
<xsl:template match="/">
------------------------------------------------------

Everywhere version is used in the xsl:stylesheet tag it is used in this
manner.
You'll notice that version is being used even though xmlns="whatever".  It
appears
that you cannot override the namespace of an element from the xsl namespace.
It seems
to me that specifying xmlns="whatever" is just specifying your default
namespace for the
rest of the document.  (I could be mistaken on this.)

Taking a look at your cases:

> 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.

Yes.

> 2) is legal, because it contains an attribute which expanded-name has a
> non-null namespace URI

Yes.

> 3) is legal, because it contains an attribute (whatever) that has a
> non-null namespace URI ("whatever:whatever" is the full name)

No.  whatever:whatever must be specified explicitly.

> 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.

Yes.  I don't see any reason that you *can't* specify xsl:version, but it's
not required.
However, I don't see anywhere in the spec. where they actually do this,
though, so it's
probably not a recommended practice.

> 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.

Yes.

> Note, however, that something like this is LEGAL
> 
> <xsl:stylesheet xsl:version="1.0" whatever="" xmlns="whatever"
> xmlns:xsl="xslt"/>

No.  whatever:whatever must be specified.

> 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.
> 

I agree...but not for the reason you're saying it's illegal.  The namespace
for version is already "xsl".  It's illegal because whatever:whatever isn't
specified.

> 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.
 
No...this would be specifying the version attribute for the xsl namespace
twice.
You'd have to do something like the following:

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

-------------------------------------------------------
Standard Disclaimer:  I sometimes don't know what I'm talking about.

- Sean T.

Mime
View raw message