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

Re: How to test whether boolean parameter has been set

Subject: Re: How to test whether boolean parameter has been set?
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 29 Oct 2018 09:29:50 -0000
Re:  How to test whether boolean parameter has been set
Am 29.10.2018 um 10:08 schrieb Jorge . chocolate.camera@xxxxxxxxx:
> In XSLT2, how would you test whether a boolean global parameter 
> optionally empty
>
> B  B  <xsl:param name="THING" as="xs:boolean?"/>
>
> has been given a value at runtime?

The spec https://www.w3.org/TR/xslt-30/#element-param says "If a 
parameter that is notexplicitly mandatory 
<https://www.w3.org/TR/xslt-30/#dt-explicitly-mandatory>has noexplicit 
default <https://www.w3.org/TR/xslt-30/#dt-explicit-default>value, then 
it has an*implicit default*value, which is the empty sequence if there 
is an|as|attribute" so in your case you could check with 
https://www.w3.org/TR/xquery-operators/#func-empty
 B  empty($THING)
although that simply checks the value is the empty sequence, you can't 
tell whether the variable has that value as its implicit default value 
or because the empty sequence was set as the value externally when 
running the stylesheet.

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.