Project

Profile

Help

Support #4264

closed

Warning to use xsl:sequence though always a single value is returned

Added by Stefan Pöschel over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2019-07-31
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
9.9
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

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

function_warning.xslt (621 Bytes) function_warning.xslt Stefan Pöschel, 2019-07-31 09:22

Please register to edit this issue

Also available in: Atom PDF