[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] xsl:with-param focus


Subject: Re: [xsl] xsl:with-param focus
From: "Martynas Jusevičius martynas@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 11 Oct 2015 19:38:19 -0000

Thanks. So basically if I need xsl:with-param values that depend on
$modes items, I have to use xsl:for-each?

On Sun, Oct 11, 2015 at 9:34 PM, Imsieke, Gerrit, le-tex
gerrit.imsieke@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
wrote:
> The param expression in #1 is evaluated in the context of each node in
> $modes, while the expression in #2 is evaluated in whatever context
> there is when <xsl:apply-templates select="$modes" b&> is processed, not
> in the context of each $modes item. So yes, itbs about context / focus.
>
> http://www.w3.org/TR/xslt20/#err-XTSE0670
> bThe focus used for computing the value specified by the xsl:with-param
> element is the same as that used for the xsl:apply-templates,
> xsl:apply-imports, xsl:next-match, or xsl:call-template element within
> which it occurs.b
>
> On 11.10.2015 21:15, Martynas JuseviD
ius martynas@xxxxxxxxxxxx wrote:
>> Hey,
>>
>> I have a question that has been bothering me -- are #1 and #2 below
>> equivalent? If not, why not? I'm guessing it has to do with
>> xsl:with-param focus. I'm only getting desired results with approach
>> #1.
>>
>> #1
>>
>>   <xsl:for-each select="$modes">
>>     <xsl:variable name="selected" select="(@rdf:about, @rdf:nodeID) =
>> '&gc;MapMode'"/>
>>     <xsl:apply-templates select="." mode="gc:OptionMode">
>>       <xsl:with-param name="selected" select="$selected"/>
>>     </xsl:apply-templates>
>>   </xsl:for-each>
>>
>> #2
>>
>>   <xsl:apply-templates select="$modes" mode="gc:OptionMode">
>>     <xsl:with-param name="selected" select="(@rdf:about, @rdf:nodeID)
>> = '&gc;MapMode'"/>
>>   </xsl:apply-templates>
>>
>> Martynas
>>
>>
>
> --
> Gerrit Imsieke
> GeschC$ftsfC<hrer / Managing Director
> le-tex publishing services GmbH
> Weissenfelser Str. 84, 04229 Leipzig, Germany
> Phone +49 341 355356 110, Fax +49 341 355356 510
> gerrit.imsieke@xxxxxxxxx, http://www.le-tex.de
>
> Registergericht / Commercial Register: Amtsgericht Leipzig
> Registernummer / Registration Number: HRB 24930
>
> GeschC$ftsfC<hrer: Gerrit Imsieke, Svea Jelonek,
> Thomas Schmidt, Dr. Reinhard VC6ckler


Current Thread