Project

Profile

Help

Bug #6313

closed

Static type error from fn:remove()

Added by Debbie Lockett 11 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
XPath conformance
Sprint/Milestone:
-
Start date:
2024-01-09
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
10, 11, 12, 9.9, trunk
Fix Committed on Branch:
10, 11, 12, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java

Description

I've discovered a weird bug when using fn:remove(); e.g.

<xsl:variable name="result" select="remove( (xs:integer('100'), xs:string('abc')), 1)"/>

Running the attached stylesheet (e.g. from the command line with net.sf.saxon.Transform -xsl:removeBug.xsl -it:main) produces a static type error:

Error at char 21 in xsl:variable/@select on line 9 column 70 of removeBug.xsl:
  XPTY0004  Required cardinality of value of variable $result is code 40960; supplied value
  has cardinality exactly one
Errors were reported during stylesheet compilation

It appears that the cardinality checking wrongly produces an error. Also note that the error message is rather mysterious and unhelpful - what is "cardinality of value of variable $result is code 40960" supposed to mean??

I see this error running Saxon 9.9 onwards; but not with Saxon 9.8.


Files

removeBug.xsl (449 Bytes) removeBug.xsl Debbie Lockett, 2024-01-09 12:35

Please register to edit this issue

Also available in: Atom PDF