xsl-list
[Top] [All Lists]

Re: [xsl] strong typed variable with restriction ?

2011-02-02 08:42:19
Or return a (fake) result and terminate then?

On Wed, Feb 2, 2011 at 2:49 PM, Michael Kay <mike(_at_)saxonica(_dot_)com> 
wrote:
On 02/02/2011 12:43, Michel Hendriksen wrote:

Or add a message in an xsl:otherwise...

<xsl:message terminate="yes|no">

  <!-- Content:template -->

</xsl:message>


No, that won't solve the problem. If the declared type of the function is
element(), then the otherwise branch (whether explicit or implicit, whether
executed or not) must return an element.

(It's not like Java, where you can declare a function to return String, and
still return null. If you want to allow a "null" return in XSLT, you need to
declare the result as "xs:string?").

Michael Kay
Saxonica

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--