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

Re: Conditional with-param

Subject: Re: Conditional with-param
From: Brian Chrisman <brian.chrisman@xxxxxx>
Date: Mon, 24 May 2004 11:58:09 -0700
xsl if select
Marco wrote:

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>


I'm not sure what you are trying to do here.. but is it possible that instead of having a conditional test and passing in a param, you instead have two templates <xsl:template match="...."> which distinguish between the two different cases in the conditional?


At that point, you could just pass both myparam1 and myparam2, (if still necessary) without the conditional.

More info on the goal would probably help... but generally I'd suspect using apply-templates select="..." and xsl:template match="..." will do what you need.


That said, I believe what you are trying to do there is out of spec: (ZVON)
|<!-- Category: instruction -->
<xsl:apply-templates
select = node-set-expression
mode = qname>
<!-- Content: (xsl:sort <http://www.zvon.org/xxl/XSLTreference/W3C/xslt.html#element-sort> | xsl:with-param <http://www.zvon.org/xxl/XSLTreference/W3C/xslt.html#element-with-param>)* -->
</xsl:apply-templates>|


sort and with-param being the only recognized child elements...

or should I write a four-cases choose instruction, with four different
options combinations?

Marco

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.