Actions
Bug #4587
closeduse of undefined system property like system-property('product') gives Internal error: bad input to string constructor
Start date:
2020-06-14
Due date:
% Done:
100%
Estimated time:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-
Description
I accidentally used an undefined system property name product
as the argument to system-property
and that gives an internal error in Saxon-JS 2 while Saxon HE Java seems to simply output an empty string.
XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="3.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="#all"
expand-text="yes">
<xsl:mode on-no-match="shallow-copy"/>
<xsl:template match="/" name="xsl:initial-template">
<xsl:next-match/>
<xsl:comment>Run with {system-property('xsl:product')} {system-property('xsl:product-version')}</xsl:comment>
</xsl:template>
</xsl:stylesheet>
Any XML input serves:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<foo>bar</foo>
</root>
Run with xslt3 -xsl:sheet.xsl -s:sample.xml
and gives output
<?xml version="1.0" encoding="UTF-8"?><root>
<foo>bar</foo>
</root>Internal error: bad input to string constructor #undefined
Error
at Object.a [as internalError] (C:\Users\foo\AppData\Roaming\npm\node_modules\xslt3\node_modules\saxon-js\SaxonJS2N.js:26:474)
with a lengthy stack trace.
Files
Please register to edit this issue
Actions
Also available in: Atom PDF Tracking page