SUMMARY:
   Sablotron incorrectly copies the xsl:version attribute from the
   top-level element of a simplified stylesheet to the output tree.

DESCRIPTION:
   Section 2.3 ("Literal Result Element as Stylesheet") of the XSL/T
   Recommendation [1] says [2]:

      "A simplified syntax is allowed for stylesheets that consist of
      only a single template for the root node. The stylesheet may
      consist of just a literal result element (see [7.1.1 Literal
      Result Elements]). Such a stylesheet is equivalent to a stylesheet
      with an xsl:stylesheet element containing a template rule
      containing the literal result element; the template rule has a
      match pattern of /.  For example [example omitted].  A literal
      result element that is the document element of a stylesheet must
      have an xsl:version attribute, which indicates the version of XSLT
      that the stylesheet requires."

   Later the recommendation says, in its description of Literal
   Result Elements [3]:

      "The created element node will have the attribute nodes that were
      present on the element node in the stylesheet tree, other than
      attributes with names in the XSLT namespace."

   According to this language, the xsl:version attribute included in the
   top-level element of a stylesheet consisting of a literal result
   element should not be included in the created element in the output.
   Nevertheless, Sablotron *is* included the xsl:version attribute in
   the output.

TEST CASE:
   MMDB2:D:\cdr\src\script\filters>cat bug.xsl
   <bug xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xsl:version="1.0">
     xsl:version is copied to output!
   </bug>

   MMDB2:D:\cdr\src\script\filters>sabcmd bug.xsl
   <foo/>
   ^Z
   <?xml version="1.0" encoding="UTF-8"?><bug xsl:version="1.0">
     xsl:version is copied to output!
   </bug>

PLATFORM/VERSION INFORMATION:
   Microsoft Windows NT Server Version 4.0 SP4
   Sablotron Version 0.51   
   sabcmd 0.51 (February 19, 2001)

[1] http://www.w3.org/TR/xslt
[2] http://www.w3.org/TR/xslt#result-element-stylesheet
[3] http://www.w3.org/TR/xslt#literal-result-element

-- 
Bob Kline
mailto:[EMAIL PROTECTED]
http://www.rksystems.com



Reply via email to