Project

Profile

Help

Bug #6636

closed

"The required type is xs:nonNegativeInteger; the supplied value 60 does not match. The supplied value type is xs:integer"

Added by Dimitre Novatchev 29 days ago. Updated 24 days ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2025-01-07
Due date:
% Done:

0%

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

Description

This is the essence of the error message by Saxon 12.4 (I am told that the same happens in 12.5).

" The required type is xs:nonNegativeInteger; the supplied value 60 does not match. The supplied value type is xs:integer ** "

The stylesheet is:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
	xmlns:xs="http://www.w3.org/2001/XMLSchema">
	 <xsl:output omit-xml-declaration="yes" indent="yes"/>
	 <xsl:strip-space elements="*"/>


  <xsl:template match="/">
     <xsl:sequence select=
"let $myFun := function($n as xs:nonNegativeInteger)
{
  $n + 1
}
    return $myFun(60)"/>
  </xsl:template>    
</xsl:stylesheet>

Interestingly enough, just adding a return type to $myFun, so that now it reads:

let $myFun := function($n as xs:nonNegativeInteger) as xs:integer

produces another interesting, but totally different error message:

" XTTE0780 An item of type xs:double cannot be converted to xs:integer as required for the result of a call to anon:f_951221468#1 In template rule with match="/" on line 7 of marrowtr.xsl An item of type xs:double cannot be converted to xs:integer as required for the result of a call to anon:f_951221468#1 ** "

Please register to edit this issue

Also available in: Atom PDF