This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23343 - XTDE0045 does not take xsl:mode into account
Summary: XTDE0045 does not take xsl:mode into account
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Working drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-24 15:13 UTC by Abel Braaksma
Modified: 2014-05-15 14:00 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2013-09-24 15:13:05 UTC
Currently, the error XTDE0045 is defined as follows:

[ERR XTDE0045] It is a dynamic error if the invocation of the stylesheet specifies an initial mode (other than the default mode) that does not match the expanded QName in the mode attribute of any template defined in the stylesheet.

However, with xsl:mode and initial="yes" (which is the default if not defined), the mode is in effect even when not specifically used on any template. An example of such use is the test mode-1405.xsl, which looks like:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
  <xsl:template match="/"><out><xsl:apply-templates/></out></xsl:template>
  <xsl:mode name="s" on-no-match="text-only-copy"/>
</xsl:stylesheet>

The result of this stylesheet should not be an error, because the mode is defined and, when set as initial mode, it comes into effect.

I think the error conditions should be updated to reflect this situation.
Comment 1 Michael Kay 2013-09-24 19:28:15 UTC
I have fixed this omission; the error now occurs if the mode is specified in neither a mode declaration, or a template rule.