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 9916 - Allow patterns to access template parameters
Summary: Allow patterns to access template parameters
Status: CLOSED WONTFIX
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Working drafts
Hardware: PC All
: 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: 2010-06-11 22:49 UTC by Evan Lenz
Modified: 2014-05-15 14:00 UTC (History)
0 users

See Also:


Attachments

Description Evan Lenz 2010-06-11 22:49:02 UTC
It would be really useful if patterns could have access to template parameters.

The parameter would still have to be declared by the template for it to be visible (as with tunnel parameters). Also, when visible, it would shadow any global variables with the same name (just as with local variables/parameters).

For example:

<xsl:template match="*[. is $node]">
  <xsl:param name="node" tunnel="yes"/>
  <found/>
</xsl:template>

<xsl:template match="*">
  <not-found/>
</xsl:template>

Right now I have to use <xsl:choose> (yuck).

I can't think of any issues with this other than the somewhat unintuitive aspect of the parameter being declared just below where it's being referenced (as opposed to above).
Comment 1 Michael Kay 2010-06-11 23:08:11 UTC
I'm a little sceptical about the value of this (but open to persuasion).

One obvious complication is the effect on xsl:next-match and xsl:apply-imports.
Comment 2 Michael Kay 2010-07-16 15:14:44 UTC
The WG looked at this with interest. But there was a general feeling that it would be too confusing.