Project

Profile

Help

What could cause error "Error SXPK0002 Cannot load expression with tag switch. The stylesheet uses Saxon-EE features"

Added by Martin Honnen over 1 year ago

While trying to figure why my AOT compilation of a .NET 8 console application using SaxonCS 12.3 for Docbox TNG stylesheets fails to produce any output I experimented with docbook.xsl compiled by SaxonCS to docbook.xsl.sef and to run that through the AOT app: that way it at least gives an error message: "Error SXPK0002 Cannot load expression with tag switch. The stylesheet uses Saxon-EE features".

What causes that error (other than obviously my experiment with AOT compilation as otherwise even the sef runs fine): could that be some use of fn:transform in docbook.xsl? What does "tag switch" refer to?


Replies (1)

RE: What could cause error "Error SXPK0002 Cannot load expression with tag switch. The stylesheet uses Saxon-EE features" - Added by Michael Kay over 1 year ago

The error message means that the SEF file contains a "switch" instruction, probably the result of optimizing an xsl:choose instruction, and Saxon-HE cannot execute a switch instruction. You can probably get around it by compiling with target:HE.

    (1-1/1)

    Please register to reply