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

XSL Choose inside a function??

Subject: XSL Choose inside a function??
From: Simon Dotschuweit <s_dotschuweit@xxxxxx>
Date: Thu, 24 Oct 2002 18:36:42 +0200
xsl choose function
Hello!

I'm a xsl newbie, just to let you know.
my problem is, that I have to write a function with a if-else statement, so I tried it like this:

<xsl:function name="xsl:getParam">
<xsl:param name="class"/>
<xsl:param name="param"/>
<xsl:choose>
  <xsl:when test="$class = '0'">
    <xsl:choose>
      <xsl:when test="$param = '0'">
        <xsl:result select="/jsp_entity/data/bean/fields/pkey"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:result select="/jsp_entity/data/bean/fields/parameter[position()=$param]"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:when>
  <xsl:otherwise>
    <xsl:result select="/jsp_entity/data/bean/classes/helper[position()=$class]/parameter[position()=$param]"/>
  </xsl:otherwise>
</xsl:choose>
</xsl:function> 

but the compiler told me this:

Error at xsl:choose on line 8 of file:/D:/e188/jsp_entity.xsl:
  This element cannot be used within xsl:function
Error at xsl:choose on line 8 of file:/D:/e188/jsp_entity.xsl:
  Element must only be used within a template body
Error at xsl:result on line 12 of file:/D:/e188/jsp_entity.xsl:
  xsl:result must have xsl:function as its parent
Error at xsl:result on line 15 of file:/D:/e188/jsp_entity.xsl:
  xsl:result must have xsl:function as its parent
Error at xsl:result on line 20 of file:/D:/e188/jsp_entity.xsl:
  xsl:result must have xsl:function as its parent

So my question is, is it really not possible to use a choose in a function??

Thank Alot!!
________________________________________________________________
Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr! 
Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=13



 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.