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

Re: strong typed variable with restriction ?

Subject: Re: strong typed variable with restriction ?
From: Wolfgang Laun <wolfgang.laun@xxxxxxxxx>
Date: Wed, 2 Feb 2011 11:53:12 +0100
Re:  strong typed variable with restriction ?
There must be a return value defined for the containing function.

On 2 February 2011 11:48, Martin Honnen <Martin.Honnen@xxxxxx> wrote:
> Andrew Welch wrote:
>> On 2 February 2011 10:16, Matthieu Ricaud-Dussarget
>> <matthieu.ricaud@xxxxxxxxx>  wrote:
>>> My code looks like :
>>> <xsl:function name="igs:get-css-rule" as="element()">
>>> <xsl:param name="foobar" as="xs:string"/>  <!--(foo|bar)-->
>>> <xsl:choose>
>>> <xsl:when test="$foobar='foo'">
>>> <xsl:sequence select="igs:get-my-foo-item()"/>
>>> </xsl:when>
>>> <xsl:when test="$css='bar'">
>>> <xsl:sequence select="igs:get-my-bar-item()"/>
>>> </xsl:when>
>>> </xsl:choose>
>>> </xsl:function>
>>> And I get such a parsing  error on my xslt :
>>>  XTTE0570: Conditional expression: If none of the conditions is
>>> an empty
>> You get the error because you must have an xsl:otherwise, you can't
>> just have xsl:whens.
> I am confused, http://www.w3.org/TR/xslt20/#xsl-choose says
> <xsl:choose>
>  <!-- Content: (xsl:when+, xsl:otherwise?) -->
> </xsl:choose>
> so in general the xsl:otherwise is optional.
> So why is the xsl:otherwise required in the above case, to ensure the result
type of the function?
> --
>        Martin Honnen
>        http://msmvps.com/blogs/martin_honnen/

Current Thread


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.
First Name
Last Name
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.