-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch error messages from <xsl:message terminate="yes"/>
#700
Comments
Looks like Saxon does not work as specified by https://www.w3.org/TR/xslt-30/#element-catch :
When I run this stylesheet, <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet exclude-result-prefixes="#all" version="3.0"
xmlns:err="http://www.w3.org/2005/xqt-errors" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" />
<xsl:template name="xsl:initial-template">
<xsl:try>
<xsl:message terminate="yes">
<test>message</test>
</xsl:message>
<xsl:catch>
<err>
<code>
<xsl:value-of select="$err:code" />
</code>
<description>
<xsl:value-of select="$err:description" />
</description>
<value>
<xsl:sequence select="$err:value" />
</value>
</err>
</xsl:catch>
</xsl:try>
</xsl:template>
</xsl:stylesheet>
C:\catch-message>java -jar "%SAXON_JAR%" -it -t -xsl:test.xsl
Saxon-HE 9.9.1.5J from Saxonica
Java version 1.8.0_231
Stylesheet compilation time: 462.3483ms
Processing (no source document) initial template = xsl:initial-template
<test>message</test>
<?xml version="1.0" encoding="UTF-8"?>
<err>
<code>XTMM9000</code>
<description>Processing terminated by xsl:message at line 11 in test.xsl</description>
<value/>
</err> |
If you write child nodes in <x:context select="/">
<abbr xml:base="{$x:xspec-uri}">AbbreviationWithoutExpansion</abbr>
</x:context> Or if you use |
@Saxonica |
Reported to saxon-help. |
Closed this issue because
|
Saxon 9.9.1.6 fixes https://saxonica.plan.io/issues/4376 and now |
I could not find documentation for how to catch error messages from
<xsl:message terminate="yes"/>
. I tried to guess<x:expect/>
withtest="$x:result?err?message"
but it seems undefined. I can workaround withtest="$x:result?err?description"
but that's the processor termination message, not the XSLT termination message.Details:
My XSLT has code like this:
I tried to test it like this:
The error message generated by
<xsl:message/>
is important and specified, so I would like to test whether the error message has the correct format. I could not find how to do that with XSpec.Two workarounds are possible in my situation:
Processing terminated by xsl:message at line 68 in abbrev.xslt
.As a side-note,
base-uri(.)
returns the empty string, I expectbase-uri(.)
to instead return the URI of the.xspec
file.The text was updated successfully, but these errors were encountered: