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

send 'with-param' determined by test

Subject: send 'with-param' determined by test
From: "Tim Watts" <timw@xxxxxxx>
Date: Mon, 7 May 2001 11:41:46 +1000
cannot contain element param
Hi,

I would like to send different parameters depending on what XML is available
to the XSLT.

If the user has already conducted a search, I would like the XSL to refer to
the parameter last used (/document/transient/param[@name = 'from-year']), or
else to use a value diffined by me in the XML
(/document/data/merchant/start-date/@year).

I have included the code below.

<xsl:call-template name="date-stripper">
     <xsl:choose>
          <xsl:when test="/document/transient/param[@name = 'from-year']">
               <xsl:with-param name="start-date-year"
select="/document/transient/param[@name = 'from-year']" />
          </xsl:when>
          <xsl:otherwise>
               <xsl:with-param name="start-date-year"
select="/document/data/merchant/start-date/@year" />
           </xsl:otherwise>
     </xsl:choose>


However when I try to run this I get the following error

Error [code:235] [URI:file:/stats/search.xsl] [line:5] [node:
element '<xsl:when>']
  XSL element 'when' cannot contain element 'with-param' at this point

Is there any way to select a param to be sent to a template dependant on a
certain criteria?

Thank you for your help

Tim Watts


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.