[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSLT 4: xsl:template/@select

Subject: Re: XSLT 4: xsl:template/@select
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 18 May 2020 17:04:06 -0000
Re:  XSLT 4: xsl:template/@select
I didn't want to create messy scoping rules for variables, e.g.

<xsl:template match="type(xs:integer)" mode="increment" select=".+1"/>

is fine, but

<xsl:template match="type(xs:integer)" mode="increment" select=".+$delta">
  <xsl:param name="delta" as="xs:integer"/>
</xsl:template>

feels a bit weird. We had similar issues with xsl:iterate - the reason
xsl:on-completion comes first is to avoid creating custom rules for variable
scoping.

Using params in match patterns gets even more interesting - useful, but
hairy:

<xsl:template match="para[@class=$class]">
  <xsl:param name="class"/>
  ...
</xsl:template>

Michael Kay
Saxonica


> On 18 May 2020, at 17:52, Graydon graydon@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
>
https://archive.xmlprague.cz/2020/files/xmlprague-2020-proceedings.pdf#page=1
21
>
> says in 5.1:
>
>> A template rule with a select attribute must not contain any xsl:param
>> or xsl:context-item declarations.
>
> I can easily imagine wanting xsl:param, particularly a tunnel parameter.
> For example, if the template functions to construct a target URI it
> would be helpful to be able to pass in the base URI as a parameter.
>
>
> --
> Graydon Saunders  | graydonish@xxxxxxxxx
> CC&s oferC)ode, C0isses swC! mC&g.
> -- Deor  ("That passed, so may this.")

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.