Errata for XSL Transformations (XSLT) Version 2.0

23 November 2007

Latest version:
http://www.w3.org/XML/2007/qt-errata/xslt-errata.html
Editor:
Michael Kay, Saxonica http://www.saxonica.com/

Abstract

This document addresses errors in the XSL Transformations (XSLT) Version 2.0 Recommendation published on 23 January 2007. It records all errors that, at the time of this document's publication, have solutions that have been approved by the XSL Working Group and/or the XML Query Working Group. For updates see the latest version of that document.

The errata are numbered, classified as Substantive, Editorial, or Markup, and are listed in reverse chronological order of their date of origin. Each entry contains the following information:

Colored boxes and shading are used to help distinguish new text from old, however these visual clues are not essential to an understanding of the change. The styling of old and new text is an approximation to its appearance in the published Recommendation, but is not normative. Hyperlinks are shown underlined in the erratum text, but the links are not live.

A number of indexes appear at the end of the document.

Substantive corrections are proposed by the XSL Working Group and/or the XQuery Working Group (both part of the XML Activity), which have consensus that they are appropriate; they are not to be considered normative until approved by a Call for Review of Proposed Corrections or a Call for Review of an Edited Recommendation.

Please report errors in this document using W3C's public Bugzilla system (instructions can be found at http://www.w3.org/XML/2005/04/qt-bugzilla). If access to that system is not feasible, you may send your comments to the W3C XSLT/XPath/XQuery public comments mailing list, public-qt-comments@w3.org. It will be very helpful if you include the string [XTerrata] in the subject line of your report, whether made in Bugzilla or in email. Each Bugzilla entry and email message should contain only one error report. Archives of the comments and responses are available at http://lists.w3.org/Archives/Public/public-qt-comments/.

Status of this Document

This is a public draft. None of the errata reported in this document have been approved by a Call for Review of Proposed Corrections or a Call for Review of an Edited Recommendation. As a consequence, they must not be considered to be normative.

Table of Contents

  Errata

     XT.E18   A change that clarified the namespace fixup rules was agreed during the Candidate Recommendation phase but was incorrectly applied.

     XT.E17   Error XTTE0950 is listed in the wrong section of Appendix E

     XT.E16   Error XTDE0485 should not be listed, as it can never happen.

     XT.E15   The explanatory text for the type-available function misrepresents the use cases for this function.

     XT.E14   This erratum defines a new system property ('supports-namespace-axis') which implementations may choose to provide to indicate whether they allow use of the namespace axis.

     XT.E13   A comma has been doubled in 13.1.2.

     XT.E12   Identity constraints are scoped to an element, so they should be applied when validating at element level.

     XT.E11   The scope of a conditional sentence is unclear.

     XT.E10   The specification does not state that duplicate attributes can be validated before they are discarded.

     XT.E9   The rules for defaulting of the namespace attribute in xsl:import-schema are unclear.

     XT.E8   The specification of xsl:for-each-group does not mention the impact of stable="no" when sorting groups.

     XT.E7   A non-normative note concerning namespace fixup is potentially misleading.

     XT.E6   There are no rules preventing misuse of the xmlns namespace.

     XT.E5   The term "static error" is poorly defined.

     XT.E4   The specification for format-date and related functions was intended to give implementations complete freedom to localize messages, but can be read as being over-prescriptive.

     XT.E3   The specification does not constrain the value of the serialization parameter doctype-public to the values that will be accepted in well-formed XML.

     XT.E2   The rules for trimming whitespace from attribute values in the stylesheet are unclear.

     XT.E1   There are errors in the published schema for XSLT 2.0.

  Indexes

    Index by affected section

    Index by Bugzilla entry

    Index by element

    Index by function

    Index by error-code


XT.E18 - editorial

See Bug 3336

Description

A change that clarified the namespace fixup rules was agreed during the Candidate Recommendation phase but was incorrectly applied.

History

7 Nov 2007: Proposed

15 Nov 2007: Accepted

Change

In 11.3 Creating Attribute Nodes Using xsl:attribute (twelfth paragraph):

Replace the text:

The prefix of the lexical QName specified in the name attribute (or the absence of a prefix) is copied to the prefix part of the expanded-QName representing the name of the new attribute node. In the event of a conflict this prefix (or absence of a prefix) may subsequently be changed during the namespace fixup process (see 5.7.3 Namespace Fixup). If the attribute is in a non-null namespace and no prefix is specified, then the namespace fixup process will invent a prefix.

By:

The prefix of the lexical QName specified in the name attribute (or the absence of a prefix) is copied to the prefix part of the expanded-QName representing the name of the new attribute node. In the event of a conflict this prefix may subsequently be added, changed, or removed during the namespace fixup process (see 5.7.3 Namespace Fixup). If the attribute is in a non-null namespace and no prefix is specified, then the namespace fixup process will invent a prefix.

XT.E17 - markup

See Bug 4878

Description

Error XTTE0950 is listed in the wrong section of Appendix E

History

10 Oct 2007: Proposed

15 Nov 2007: Accepted

Change

In Appendix E, move error XTTE0950 from the Static Errors section to the Type Errors section.

XT.E16 - substantive

See Bug 3069

Description

Error XTDE0485 should not be listed, as it can never happen. (The change log in the Proposed Recommendation reported that this error had been removed, but the decision to delete it was not implemented.)

History

10 Oct 2007: Proposed

15 Nov 2007: Accepted

Change

In 5.7.3 Namespace Fixup (sixth paragraph):

Delete the text:

err:XTDE0485

It is a non-recoverable dynamic error if namespace fixup is performed on an element that contains among the typed values of the element and its attributes two values of type xs:QName or xs:NOTATION containing conflicting namespace prefixes, that is, two values that use the same prefix to refer to different namespace URIs.

XT.E15 - substantive

See Bug 4696

Description

The explanatory text for the type-available function misrepresents the use cases for this function. The effect of the erratum is to document its limitations when used in a use-when expression.

History

10 Oct 2007: Proposed

15 Nov 2007: Accepted

Changes

  1. In 18.1.4 Testing Availability of Types (first paragraph):

    Replace the text:

    The type-available function can be used, for example with the [xsl:]use-when attribute (see 3.12 Conditional Element Inclusion), to explicitly control how a stylesheet behaves if a particular schema type is not available in the static context.

    By:

    The type-available function can be used to control how a stylesheet behaves if a particular schema type is not available in the static context.

  2. In 18.1.4 Testing Availability of Types (fifth paragraph):

    Insert after the text:

    err:XTDE1428

    It is a non-recoverable dynamic error if the argument [passed to the type-available function] does not evaluate to a string that is a valid QName, or if there is no namespace declaration in scope for the prefix of the QName. If the processor is able to detect the error statically (for example, when the argument is supplied as a string literal), then the processor may optionally signal this as a static error.

    The following:

    Note:

    The type-available function is of limited use within an [xsl:]use-when expression, because the static context for the expression does not include any user-defined types.

XT.E14 - substantive

See Bug 4546

Description

This erratum defines a new system property ('supports-namespace-axis') which implementations may choose to provide to indicate whether they allow use of the namespace axis.

History

10 Oct 2007: Proposed

7 Nov 2007: Amended

15 Nov 2007: Accepted

Change

In 16.6.5 system-property (first bulleted list):

Insert after the text:

The following:

In addition, processors may support the following system property in the XSLT namespace. A processor that does not support this property will return a zero-length string if the property is requested.

XT.E13 - editorial

See Bug 4849

Description

A comma has been doubled in 13.1.2.

History

10 Oct 2007: Proposed

15 Nov 2007: Accepted

Change

In 13.1.2 Comparing Sort Key Values (sixth paragraph):

Replace the text:

In general, comparison of two ordinary values is performed according to the rules of the XPath lt operator. To ensure a total ordering, the same implementation of the lt operator must be used for all the comparisons: the one that is chosen is the one appropriate to the most specific type to which all the values can be converted by subtype substitution and/or type promotion. For example, if the sequence contains both xs:decimal and xs:double values, then the values are compared using xs:double comparison, even when comparing two xs:decimal values. NaN values, for sorting purposes, are considered to be equal to each other, and less than any other numeric value. Special rules also apply to the xs:string and xs:anyURI types, and types derived by restriction therefrom,, as described in the next section.

By:

In general, comparison of two ordinary values is performed according to the rules of the XPath lt operator. To ensure a total ordering, the same implementation of the lt operator must be used for all the comparisons: the one that is chosen is the one appropriate to the most specific type to which all the values can be converted by subtype substitution and/or type promotion. For example, if the sequence contains both xs:decimal and xs:double values, then the values are compared using xs:double comparison, even when comparing two xs:decimal values. NaN values, for sorting purposes, are considered to be equal to each other, and less than any other numeric value. Special rules also apply to the xs:string and xs:anyURI types, and types derived by restriction therefrom, as described in the next section.

XT.E12 - substantive

See Bug 4548

Description

Identity constraints are scoped to an element, so they should be applied when validating at element level. This change is worded as a "should" so that existing processors remain conformant.

History

8 May 2007: Proposed

21 Jun 2007: Amended

15 Nov 2007: Accepted

Change

In 19.2.1.3 The Validation Process (first bulleted list, second item):

Replace the text:

The validation rule "Validation Rule: Identity-constraint Satisfied" is not applied.

By:

The validation rule "Validation Rule: Identity-constraint Satisfied" should be applied.

XT.E11 - editorial

See Bug 4620

Description

The scope of a conditional sentence is unclear. It is possible to misread the paragraph in section 2.4 that starts "If the initial template has an as attribute..." as if this condition applies to the whole paragraph, whereas it actually applies only to the first sentence of the paragraph.

History

10 Jun 2007: Proposed

21 Jun 2007: Accepted

Change

In 2.4 Executing a Transformation (starting at third paragraph):

Replace the text:

If the initial template has an as attribute, then the result sequence of the initial template is checked against the required type in the same way as for any other template. If this result sequence is non-empty, then it is used to construct an implicit final result tree, following the rules described in 5.7.1 Constructing Complex Content: the effect is as if the initial template T were called by an implicit template of the form:

<xsl:template name="IMPLICIT">
  <xsl:result-document href="">
    <xsl:call-template name="T"/>
  </xsl:result-document>
</xsl:template>

By:

The result sequence produced by evaluating the initial template is handled as follows:

  1. If the initial template has an as attribute, then the result sequence of the initial template is checked against the required type in the same way as for any other template.

  2. If the result sequence is non-empty, then it is used to construct an implicit final result tree, following the rules described in 5.7.1 Constructing Complex Content: the effect is as if the initial template T were called by an implicit template of the form:

    <xsl:template name="IMPLICIT">
      <xsl:result-document href="">
        <xsl:call-template name="T"/>
      </xsl:result-document>
    </xsl:template>

XT.E10 - substantive

See Bug 4600

Description

The specification does not state that duplicate attributes can be validated before they are discarded. This erratum clarifies that an error may be reported when a constructed attribute has an invalid value, even if the attribute is subsequently discarded as a duplicate.

History

6 Jun 2007: Proposed

21 Jun 2007: Accepted

Change

In 5.7.1 Constructing Complex Content (first numbered list, ninth item):

Replace the text:

If an attribute A in the result sequence has the same name as another attribute B that appears later in the result sequence, then attribute A is discarded from the result sequence.

By:

If an attribute A in the result sequence has the same name as another attribute B that appears later in the result sequence, then attribute A is discarded from the result sequence. Before discarding attribute A, the processor may signal any type errors that would be signaled if attribute B were not present.

XT.E9 - editorial

See Bug 4591

Description

The rules for defaulting of the namespace attribute in xsl:import-schema are unclear.

History

30 May 2007: Proposed

21 Jun 2007: Accepted

7 Nov 2007: Amended

15 Nov 2007: Accepted

Change

In 3.14 Importing Schema Components (fifth paragraph):

Replace the text:

If the xsl:import-schema element contains an xs:schema element, then the schema-location attribute must be absent, and the namespace attribute must either have the same value as the targetNamespace attribute of the xs:schema element (if present), or must be absent, in which case its effective value is that of the targetNamespace attribute of the xs:schema element if present or the zero-length string otherwise.

By:

If the xsl:import-schema element contains an xs:schema element, then the schema-location attribute must be absent, and one of the following must be true:

XT.E8 - editorial

See Bug 4589

Description

The specification of xsl:for-each-group does not mention the impact of stable="no" when sorting groups. This erratum confirms that stable="no" has the expected effect in this situation.

History

29 May 2007: Proposed

21 Jun 2007: Accepted

Change

In 14.3 The xsl:for-each-group Element (twenty-first paragraph):

Replace the text:

Otherwise, the xsl:sort elements immediately within the xsl:for-each-group element define the processing order of the groups (see 13 Sorting). They do not affect the order of items within each group. Multiple sort key components are allowed, and are evaluated in major-to-minor order. If two groups have the same values for all their sort key components, they are processed in order of first appearance.

By:

Otherwise, the xsl:sort elements immediately within the xsl:for-each-group element define the processing order of the groups (see 13 Sorting). They do not affect the order of items within each group. Multiple sort key components are allowed, and are evaluated in major-to-minor order. If two groups have the same values for all their sort key components, they are processed in order of first appearance if the sort key specification is stable, otherwise in an implementation-dependent order.

XT.E7 - editorial

See Bug 4513

Description

A non-normative note concerning namespace fixup is potentially misleading. This erratum confirms that the rules for choice of a prefix in xsl:element and xsl:attribute take precedence.

History

29 Apr 2007: Proposed

17 May 2007: Accepted

Change

In 11.7 Creating Namespace Nodes (first note, third paragraph):

Replace the text:

Namespace prefixes for element and attribute names are effectively established by the namespace fixup process described in 5.7.3 Namespace Fixup. The fixup process ensures that an element has in-scope namespace nodes for the namespace URIs used in the element name and in its attribute names, and the serializer will typically use these namespace nodes to determine the prefix to use in the serialized output. The fixup process cannot generate namespace nodes that are inconsistent with those already present in the tree. This means that it is not possible for the processor to decide the prefix to use for an element or for any of its attributes until all the namespace nodes for the element have been added.

By:

Namespace prefixes for element and attribute names are initially established by the rules of the instruction that creates the element or attribute node, and in the event of conflicts, they may be changed by the namespace fixup process described in 5.7.3 Namespace Fixup. The fixup process ensures that an element has in-scope namespace nodes for the namespace URIs used in the element name and in its attribute names, and the serializer will typically use these namespace nodes to determine the prefix to use in the serialized output. The fixup process cannot generate namespace nodes that are inconsistent with those already present in the tree. This means that it is not possible for the processor to decide the prefix to use for an element or for any of its attributes until all the namespace nodes for the element have been added.

XT.E6 - substantive

See Bug 4464

Description

There are no rules preventing misuse of the xmlns namespace.

History

23 Apr 2007: Proposed

17 May 2007: Accepted

Changes

  1. In 3.2 Reserved Namespaces (first bulleted list, fifth item):

    Insert after the text:

    • [Definition] The schema instance namespace http://www.w3.org/2001/XMLSchema-instance is used as defined in [XML Schema Part 1] . Attributes in this namespace, if they appear in a stylesheet, are treated by the XSLT processor in the same way as any other attributes.

    The following:

    • The namespace http://www.w3.org/2000/xmlns/ is reserved for use as described in [Namespaces in XML 1.0] . No element or attribute node can have a name in this namespace, and although the prefix xmlns is implicitly bound to this namespace, no namespace node will ever define this binding.

  2. In 11.2 Creating Element Nodes Using xsl:element (tenth paragraph):

    Replace the text:

    It is a non-recoverable dynamic error if the effective value of the namespace attribute [of the xsl:element instruction] is not in the lexical space of the xs:anyURI data type.

    By:

    It is a non-recoverable dynamic error if the effective value of the namespace attribute [of the xsl:element instruction] is not in the lexical space of the xs:anyURI data type or if it is the string http://www.w3.org/2000/xmlns/.

  3. In 11.2 Creating Element Nodes Using xsl:element (eleventh paragraph):

    Insert after the text:

    The prefix of the lexical QName specified in the name attribute (or the absence of a prefix) is copied to the prefix part of the expanded-QName representing the name of the new element node. In the event of a conflict a prefix may subsequently be added, changed, or removed during the namespace fixup process (see 5.7.3 Namespace Fixup).

    The following:

    The term conflict here means any violation of the constraints defined in [Data Model] , for example the use of the same prefix to refer to two different namespaces in the element and in one of its attributes, the use of the prefix xml to refer to a namespace other than the XML namespace, or any use of the prefix xmlns.
  4. In 11.3 Creating Attribute Nodes Using xsl:attribute (eleventh paragraph):

    Replace the text:

    It is a non-recoverable dynamic error if the effective value of the namespace attribute [of the xsl:attribute instruction] is not in the lexical space of the xs:anyURI data type.

    By:

    It is a non-recoverable dynamic error if the effective value of the namespace attribute [of the xsl:attribute instruction] is not in the lexical space of the xs:anyURI data type or if it is the string http://www.w3.org/2000/xmlns/.

  5. In 11.3 Creating Attribute Nodes Using xsl:attribute (twelfth paragraph):

    Insert after the text:

    The prefix of the lexical QName specified in the name attribute (or the absence of a prefix) is copied to the prefix part of the expanded-QName representing the name of the new attribute node. In the event of a conflict this prefix (or absence of a prefix) may subsequently be changed during the namespace fixup process (see 5.7.3 Namespace Fixup). If the attribute is in a non-null namespace and no prefix is specified, then the namespace fixup process will invent a prefix.

    The following:

    The term conflict here means any violation of the constraints defined in [Data Model] , for example the use of the same prefix to refer to two different namespaces in different attributes of the same element, the use of the prefix xml to refer to a namespace other than the XML namespace, or any use of the prefix xmlns.
  6. In 11.7 Creating Namespace Nodes (fourth paragraph):

    Replace the text:

    It is a non-recoverable dynamic error if the string value of the new namespace node [created using xsl:namespace] is not valid in the lexical space of the data type xs:anyURI. [err:XTDE0835]

    By:

    It is a non-recoverable dynamic error if the string value of the new namespace node is not valid in the lexical space of the data type xs:anyURI, or if it is the string http://www.w3.org/2000/xmlns/.

  7. In 5.7.3 Namespace Fixup (first bulleted list, fourth item):

    Replace the text:

    A namespace node must not have the name xmlns.

    By:

    A namespace node must not have the name xmlns or the string value http://www.w3.org/2000/xmlns/.

XT.E5 - editorial

See Bug 2388

Description

The term "static error" is poorly defined. The concept is defined in terms of when it is detected, which is circular, given that the specification goes on to state requirements on processors to detect static errors before evaluation starts.

History

17 Apr 2007: Proposed

17 Apr 2007: Accepted

Change

In 2.9 Error Handling (first paragraph):

Replace the text:

[Definition] An error that is detected by examining a stylesheet before execution starts (that is, before the source document and values of stylesheet parameters are available) is referred to as a static error.

By:

[Definition] An error that can be detected by examining a stylesheet before execution starts (that is, before the source document and values of stylesheet parameters are available) is referred to as a static error.

XT.E4 - editorial

See Bug 2321

Description

The specification for format-date and related functions was intended to give implementations complete freedom to localize messages, but can be read as being over-prescriptive.

History

17 Apr 2007: Proposed

17 Apr 2007: Accepted

Change

In 16.5.2 The Language, Calendar, and Country Arguments (second paragraph):

Replace the text:

If the fallback representation uses a different calendar from that requested, the output string must be prefixed with [Calendar: X] where X identifies the calendar actually used. The string Calendar should be localized using the requested language if available. If the fallback representation uses a different language from that requested, the output string should be prefixed with [Language: Y] where Y identifies the language actually used. The string Language may be localized in an implementation-dependent way. If a particular component of the value cannot be output in the requested format, it should be output in the default format for that component.

By:

If the fallback representation uses a different calendar from that requested, the output string must identify the calendar actually used, for example by prefixing the string with [Calendar: X] (where X is the calendar actually used), localized as appropriate to the requested language. If the fallback representation uses a different language from that requested, the output string must identify the language actually used, for example by prefixing the string with [Language: Y] (where Y is the language actually used) localized in an implementation-dependent way. If a particular component of the value cannot be output in the requested format, it should be output in the default format for that component.

XT.E3 - substantive

See Bug 4372

Description

The specification does not constrain the value of the serialization parameter doctype-public to the values that will be accepted in well-formed XML. The primary place for such rules is the Serialization specification, but this erratum adds a sentence to the XSLT specification to make it clear that restrictions apply. The change affects xsl:output and xsl:result-document.

A corresponding change is being made to the Serialization specification: see Serialization erratum E1.

History

16 Apr 2007: Proposed

15 Nov 2007: Accepted

Change

In 20 Serialization (second bulleted list, fifth item):

Insert after the text:

The following:

The value of doctype-public must conform to the rules for a PubidLiteralXML (see [XML 1.0] ).

XT.E2 - substantive

See Bug 4315

Description

The rules for trimming whitespace from attribute values in the stylesheet are unclear.

History

3 Apr 2007: Proposed

17 Apr 2007: Accepted

Change

In 2.2 Notation (first bulleted list, third item, second paragraph):

Replace the text:

In all cases where this specification states that the value of an attribute must be one of a limited set of values, leading and trailing whitespace in the attribute value is ignored. In the case of an attribute value template, this applies to the effective value obtained when the attribute value template is expanded.

By:

Except where the set of allowed values of an attribute is specified using the italicized name string or char, leading and trailing whitespace in the attribute value is ignored. In the case of an attribute value template, this applies to the effective value obtained when the attribute value template is expanded.

XT.E1 - substantive

See Bug 4237

Description

There are errors in the published schema for XSLT 2.0. A new schema is published at http://www.w3.org/2007/11/schema-for-xslt20.xsd

History

16 Mar 2007: Proposed

17 Apr 2007: Accepted

Change

The changes made to the schema are as follows:

A global element definition for xsl:document has been added.

The content model for xsl:sequence has been restricted to match the element proforma in the normative text.

The new schema replaces the schema published as Appendix G.


Index by affected section

2.2 Notation

XT.E2

2.4 Executing a Transformation

XT.E11

2.9 Error Handling

XT.E5

3.2 Reserved Namespaces

XT.E6

3.14 Importing Schema Components

XT.E9

5.7.1 Constructing Complex Content

XT.E10

5.7.3 Namespace Fixup

XT.E6 XT.E16

11.2 Creating Element Nodes Using xsl:element

XT.E6

11.3 Creating Attribute Nodes Using xsl:attribute

XT.E6 XT.E18

11.7 Creating Namespace Nodes

XT.E6 XT.E7

13.1.2 Comparing Sort Key Values

XT.E13

14.3 The xsl:for-each-group Element

XT.E8

16.5.2 The Language, Calendar, and Country Arguments

XT.E4

16.6.5 system-property

XT.E14

18.1.4 Testing Availability of Types

XT.E15

19.2.1.3 The Validation Process

XT.E12

20 Serialization

XT.E3

E Summary of Error Conditions (Non-Normative)

XT.E17

G Schema for XSLT Stylesheets (Non-Normative)

XT.E1

Index by Bugzilla entry

Bug #2321: XT.E4

Bug #2388: XT.E5

Bug #3069: XT.E16

Bug #3336: XT.E18

Bug #4237: XT.E1

Bug #4315: XT.E2

Bug #4372: XT.E3

Bug #4464: XT.E6

Bug #4513: XT.E7

Bug #4546: XT.E14

Bug #4548: XT.E12

Bug #4589: XT.E8

Bug #4591: XT.E9

Bug #4600: XT.E10

Bug #4620: XT.E11

Bug #4696: XT.E15

Bug #4849: XT.E13

Bug #4878: XT.E17

Index by element

xsl:attribute: XT.E6 XT.E7 XT.E10 XT.E18

xsl:copy: XT.E12

xsl:copy-of: XT.E12

xsl:document: XT.E1

xsl:element: XT.E6 XT.E7 XT.E10 XT.E12

xsl:for-each-group: XT.E8

xsl:import-schema: XT.E9

xsl:namespace: XT.E6 XT.E7

xsl:output: XT.E3

xsl:result-document: XT.E3

xsl:sequence: XT.E1

xsl:sort: XT.E8

Index by function

format-date: XT.E4

format-dateTime: XT.E4

format-time: XT.E4

system-property: XT.E14

type-available: XT.E15

Index by error-code

XTDE0485: XT.E16

XTDE0835: XT.E6

XTTE0950: XT.E17