cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Boag/CAM/Lotus" <Scott_B...@lotus.com>
Subject Re: R:R:pathargs problem
Date Mon, 28 Feb 2000 22:52:23 GMT

Stefano Mazzocchi wrote:
> No, wait a second. My fix is right, following the XSLT specification you
> should add the version attribute to the XSLT namespace, otherwise,
> whose's version is that?
>
> Scott, is there a bug in Xalan? who's right?

I'm not sure what the final stylesheet looks like.  When you are using the
"Literal Result Element as a Stylesheet" feature, the version attribute
should be namespaced, otherwise it should not.  For example, you can do:

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

or

<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="/">
<html>
  <head>
    <title>Expense Report Summary</title>
  </head>
  <body>
    <p>Total Amount: <xsl:value-of select="expense-report/total"/></p>
  </body>
</html>
</xsl:template>
</xsl:stylesheet>

I don't think an XSLT processor should handle any attributes in a XSLT
namespaced element that have a XSLT namespace on them (these attributes
normally have a null namespace).

Note the difference in the DTD for the two stylesheet types:

<!ENTITY % top-level-atts '
  extension-element-prefixes CDATA #IMPLIED
  exclude-result-prefixes CDATA #IMPLIED
  id ID #IMPLIED
  version NMTOKEN #REQUIRED
  xmlns:xsl CDATA #FIXED "http://www.w3.org/1999/XSL/Transform"
  %space-att;
'>

<!ENTITY % result-element-atts '
  xsl:extension-element-prefixes CDATA #IMPLIED
  xsl:exclude-result-prefixes CDATA #IMPLIED
  xsl:use-attribute-sets %qnames; #IMPLIED
  xsl:version NMTOKEN #IMPLIED
'>

I think handling of the xsl:version attribute in Literal Result Element
stylesheets was added a few weeks ago, so it's possible that you're behind
a version?

-scott






Mime
View raw message