xsl-list
[Top] [All Lists]

Re: [xsl] How to test whether boolean parameter has been set?

2018-10-29 04:29:56
Am 29.10.2018 um 10:08 schrieb Jorge . 
chocolate(_dot_)camera(_at_)gmail(_dot_)com:
In XSLT2, how would you test whether a boolean global parameter optionally empty

    <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
  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.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>