oleksii.sapov-erlinger
oleksii.sapov-erlinger

Reputation: 412

Pass parameter(s) to the XSLT mode

When applying

<apply-templates  mode="extract.controlEvents" select="$extractedEvents">
     <with-param name="pMultiRestMeasures" select="$multiRestMeasures"/>
   </apply-templates>

I expected $pMultiRestMeasures to be availble in the matched template:

<template match="measure[.//mRest]" mode="extract.controlEvents">
        <param name="pMultiRestMeasures"/>
    
        <choose>
          <when test="$pMultiRestMeasures">
         ...
          </when>
        </choose>
    
      </template>

But this doesn't seem to be the case. I also tried using @tunnel.

I need to perform calculations before the mode is called. Numerous other templates are invoked using this mode, but they do not require this parameter. "on-no-match", the identity transform is invoked. Note: the mode(s) are not explicitly declared using xsl:mode.

Upvotes: 0

Views: 61

Answers (1)

oleksii.sapov-erlinger
oleksii.sapov-erlinger

Reputation: 412

Here is the XSLT Fiddle with an MRE.

But I solved it for me by adding @tunnel. Don't know why it did not work the first time.

Upvotes: 1

Related Questions