I’m using Oxygen 24 with Saxon-EE 9.9.1.7 and I’m trying to run XSLT in the debugger but it fails to run however if I just run it outside of the debugger it does run?
I’m running an XSLT over the following source XML doc:
<MSG02>
<IDOC BEGIN="1">
<E1EDK01 SEGMENT="1">
<BELNR>1</BELNR>
</E1EDK01>
<E1EDK03 SEGMENT="1">
<IDDAT>001</IDDAT>
<DATUM>20240430</DATUM>
</E1EDK03>
<E1EDKT1 SEGMENT="1">
<TDID>Z001</TDID>
<TSSPRAS>D</TSSPRAS>
<TSSPRAS_ISO>DE</TSSPRAS_ISO>
<E1EDKT2 SEGMENT="1">
<TDLINE>POconfType:accept;</TDLINE>
<TDFORMAT>=</TDFORMAT>
</E1EDKT2>
</E1EDKT1>
<E1EDKT1 SEGMENT="1">
<TDID>Z001</TDID>
<TSSPRAS>E</TSSPRAS>
<TSSPRAS_ISO>EN</TSSPRAS_ISO>
<E1EDKT2 SEGMENT="1">
<TDLINE>POconfType:accept;</TDLINE>
<TDFORMAT>=</TDFORMAT>
</E1EDKT2>
</E1EDKT1>
</IDOC>
</MSG02>
With the following XSLT:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:saxon="http://saxon.sf.net/"
exclude-result-prefixes="#all">
<xsl:param name="xquery-param1" as="xs:string" expand-text="no"><![CDATA[
element E1EDKT1 {attribute SEGMENT {"1"},
element TDID { "ZG04" },
if (exists(/*/IDOC/E1EDKT1[TDID="ZG04"]/E1EDKT2/TDLINE)) then
(element TSSPRAS {"E"},
element TSSPRAS_ISO {"EN"},
for $kt in (/*/IDOC/E1EDKT1[TDID="ZG04"][1]/E1EDKT2/TDLINE)
return
element E1EDKT2 {attribute SEGMENT {"1"},
$kt
}
)
else(),
if (exists(/*/IDOC/E1EDK01/BELNR)) then
( element E1EDKT2 {attribute SEGMENT {"1"},
element TDLINE { concat("DateOfSupply:",/*/IDOC/E1EDK03[IDDAT="001"]/DATUM/concat(substring(.,1,4),"-",substring(.,5,2),"-",substring(.,7,2))) }
}
)
else()
}
]]></xsl:param>
<xsl:output indent="yes"/>
<xsl:variable name="xquery1" select="saxon:compile-query($xquery-param1)"/>
<xsl:template match="/" name="xsl:initial-template">
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="E1EDKT1[1]">
<xsl:copy-of select="saxon:query($xquery1)"/>
</xsl:template>
</xsl:stylesheet>
Before debugging I get the following warning:
- For parameter ‘xquery-param1, the variable/parameter $kt should be placed in a ‘Text Value Template’
When I run the debugger I get:
- W Evaluation will always throw a dynamic error: Namespace prefix {myfunc} has not been declared
- E Internal error evaluating template rule at line 29 in module file:/C:/…
The error stops the debugger from completing whereas if I do a normal run it generates an output as expected?