RE: several questions on XML to HTML processing with XSL

Subject: RE: several questions on XML to HTML processing with XSL
From: H.vanderLinden@xxxxxxxxxxxxx
Date: Tue, 13 Jun 2000 09:56:48 +0200

> From: Kay Michael <Michael.Kay@xxxxxxx>
> Date: Fri, 9 Jun 2000 15:50:14 +0100 
>> 4. How do I declare a variable parametername?
>> I'd like to do the following, but Saxon returns an errormessage on the
>> <xsl:with-param> line (invalid $ character).
>> <xsl:variable 
>> name="ParamName">someXMLtag/@someAttribute</xsl:variable>
>> <xsl:call-template name="SomeTemplateName">
>>    <xsl:with-param name="$ParamName">whateverValue</xsl:with-param>
>> </xsl:call-template>
>> How should I do this?

>Leave out the "$" sign. It's not part of the parameter's name, it's only
>used to identify a variable when used within an XPath expression.

Sorry, I left something out. The template 'SomeTemplateName' has several
parameters which I initialised to
a default value and I only want to set one to a different value, but this
one parameter can be variable.

So it's something like this:

<xsl:template name="SomeTemplateName">
<xsl:param name="param1">true</xsl:param> 
<xsl:param name="param2">true</xsl:param>
<xsl:param name="param3">true</xsl:param>
<xsl:param name="param4">true</xsl:param>

<!-- do some processing here based on the value of the parameters -->


the variable "ParamName" will be either "param1", "param2" etc. and
'whateverValue' could be e.g. 'false'.

So instead of passing on the value of all parameters I just want to pass on
the only parameter that's changed.

I vaguely recall that someone has once asked a similar question, but I can't
find it in the archives.


Helma van der Linden
Medical Informatics

 XSL-List info and archive:

Current Thread