[Bug 29210] New: [xslt30] xsl:apply-imports and xsl:next-match from within xsl:override


            Bug ID: 29210
           Summary: [xslt30] xsl:apply-imports and xsl:next-match from
                    within xsl:override
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 3.0
          Assignee: mike@saxonica.com
          Reporter: mike@saxonica.com
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

(A) Error XTSE3460 says:

[ERR XTSE3460] It is a static error if an xsl:apply-imports element appears in
a template rule declared within an xsl:override element. (To invoke the
template rule that is being overridden, xsl:next-match should therefore be

This doesn't allow for calling xsl:apply-imports from a named template which is
itself invoked from such a template rule. We therefore need a dynamic version
of the error:

[ERR XTDE3461] It is a dynamic error if an xsl:apply-imports instruction is
evaluated when  the current template rule is a template rule whose declaration
is a child of an xsl:override element.

with a note explaining why this is necessary.

(A2) Alternatively we could abolish this error, and say:

If the current template rule is declared within an xsl:override element, then
apply-imports considers all the template rules declared (with the corresponding
mode) in the used package.

(B) I also noticed an inaccuracy in this note in section 6.8:

Because a template rule declared as a child of xsl:override has higher
precedence than any template rule declared in the used package (see 3.5.4
Overriding Template Rules from a Used Package), the effect of xsl:next-match
within such a template rule is to consider as candidates first the preceding
sibling template rules within the same xsl:override element, and then all
template rules in the used package.

The reference to "preceding sibling template rules" here is wrong. It considers
first all the preceding sibling rules with the same priority, then all the
sibling rules with lower priority (explicit or implicit), and then the template
rules in the used package.

(C) I think we should add a note to make it clear that when xsl:next-match (or,
with this suggested change, xsl:apply-imports) selects a template rule declared
in the used package, the current mode does not change: it remains the mode
belonging to the using package. This means that if the template selected using
next-match does xsl:apply-templates with mode="#current", the template rules in
the overriding package are considered.

You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 19 October 2015 11:36:53 UTC