Support #4264
closedWarning to use xsl:sequence though always a single value is returned
0%
Description
I have an XSLT with some helper functions. After updating from Saxon 9.8 to 9.9 (to be precise: 9.9.1.4), I now get warnings like the following:
Warning at function subcheck:string_to_amount on line 92 of irt_functions.xsl:
SXWN9000: A function that computes atomic values should use xsl:sequence rather than xsl:value-of
Warning at function subcheck:imsc1_signalling_present on line 108 of irt_functions.xsl:
SXWN9000: A function that computes atomic values should use xsl:sequence rather than xsl:value-of
Warning at function subcheck:ttml_style_chain_exists on line 119 of irt_functions.xsl:
SXWN9000: A function that computes atomic values should use xsl:sequence rather than xsl:value-of
(this output actually results from using this file: https://github.com/IRT-Open-Source/xcf_suite_ttml/blob/d10e78a223fad983a31082cb1603568c039f35db/irt_functions.xsl)
All of the affected functions have an explicitely defined returned type that is an atomic value (i.e. a single atomic value, e.g. xs:decimal
or xs:boolean
). Unless I have overseen something, it is fine then to use xsl:value-of
instead of xsl:sequence
(I like to restrict the function result as early as possible). So the warning should not appear in such cases.
Please find attached a minimum test case that is adopted from the first occurence in the functions file mentioned above. I used the following cmdline:
java -jar saxon9he.jar -s:function_warning.xslt -xsl:function_warning.xslt -o:output.xml
And the following output:
Warning at function test:string_to_amount on line 4 of function_warning.xslt:
SXWN9000: A function that computes atomic values should use xsl:sequence rather than xsl:value-of
Files
Please register to edit this issue