|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Conditional with-param
Hi Marco,
Without understanding exactly what it is you are trying to accomplish
the easiest way to solve your particular dilemma is to create a variable
outside of the xsl:apply-templates element that uses conditional logic
to determines its value. Also, to ensure that you only get one matching
value I would use an xsl:choose block to determine the value of the
variable. For example:
<xsl:variable name="foo">
<xsl:choose>
<xsl:when test="condition1">
...value if condition1 is true
</xsl:when>
<xsl:otherwise>
...value if condition1 is not true
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:apply-templates select="/foo/bar">
<xsl:with-param name="foo" select="$foo"/>
</xsl:apply-templates>
Within your matching template you would need to create a parameter
called 'foo' that would hold the value passed to it using xsl:with-param
and having the same name.
Hope this helps!
<M:D/>
> -----Original Message-----
> From: Marco [mailto:brbromo@xxxxxx]
> Sent: Thursday, May 20, 2004 7:35 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Conditional with-param
>
> Is it possible to do something like
>
> <xsl:apply-templates>
> <xsl:if select="condition1">
> <xsl:with-param name="myparam1">
> </xsl:if>
> <xsl:if select="condition2">
> <xsl:with-param name="myparam2">
> </xsl:if>
> </xsl:apply-templates>
>
> or should I write a four-cases choose instruction, with four different
> options combinations?
>
> Marco
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








