Roee Vakrat
Roee Vakrat

Reputation: 51

Making Saxon XSLT engine more permissive (types mismatch error)

I am converting a large number of XSLs from a native XSL 1.0 syntax to be Saxon-XSL3 compatible.

A common merge error I tend to get is due to types mismatch, for example:

XPTY0004: The required item type of the first argument of fn:string-length() is xs:string; the supplied value 1 does not match. The supplied value is of type xs:integer

When I used MSXML 6.0 engine, this type of merge error was never raised.

My question is - can I somehow configure Saxon engine to be more permissive and ignore error of this sort?

Thanks!

Upvotes: 1

Views: 64

Answers (1)

Michael Kay
Michael Kay

Reputation: 163458

You have the option of running in 1.0 backwards-compatibility mode by specifying version="1.0" on the xsl:stylesheet element. But my recommendation is to move forwards and make the changes needed for the stricter type-checking of 2.0+; the permissive 1.0 rules lead to many hard-to-detect errors.

Upvotes: 2

Related Questions