Question

I am trying to use the min function on numbers. In the documentation I have seen its possible to use integers as input. I Have also tried number($test2) without result.

<xsl:variable name="test2" select="string-length(substring-before($resourcepath, 'se'))" />
<xsl:variable name="test3" select="min($test2 , $test2 )" />

Required item type of second argument of min() is xs:string; supplied value has item type xs:integer

Was it helpful?

Solution

I am trying to use the min function on numbers.

The min() function works on sequences, not on numbers directly. Instead of:

min($a, $b)

try:

min(($a, $b))

Otherwise the function expects $b to be the optional collation argument (which needs to be a string).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top