Bug #3098
closedSupplied value "..." is not a valid xs:base64
100%
Description
I hope that I am right that I have found a bug in the runtime of Saxon-JS-beta-0.9.1.1. I have an xsl:choose, the first test compares a string parameter with a string literal. Although the parameter can hardly be anything else but an xs:string (also by the as= clause of its definition), I get the error "Supplied value "..." is not a valid xs:base64" in the javascript console of Firefox and Chrome. If I cast the parameter by wrapping it in xs:string(), the error remains. But if I concat an empty string before doing the compare, all goes well, even when the parameter value matches another xsl:when inside the same xsl:choose-stanza.
Maybe useful to remark that part of its life time, the parameter is a tunnel parameter.
You can watch the working version at http://www.masereeuw.nl/tangram. I'll be happy to supply source code if that helps.
Here is an abbridged snipped of my code:
@<xsl:template name="do-next-figure">
<xsl:param name="next-figure" as="xs:string" required="yes"/>
<xsl:choose>
<!-- Intended line was:
<xsl:when test="$next-figure eq 'transparant-tangram'">
but for some reason this fails with an error in the Javascript console:
XError: Supplied value "sitting-cat" is not a valid xs:base64 at file:/home/pieter/saxonjs-experimenten/tangram/tangram4saxonjs.xslt#227
When we change the test as shown (concatening an empty string, then compare), all goes well, even if the other comparable tests are
left as they are.
-->
<xsl:when test="concat($next-figure, '') eq 'transparant-tangram'">
<xsl:call-template name="do-transparant-tangram">
<xsl:with-param name="transforms" select="$tangram-transforms"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$next-figure eq 'blue-tangram'">
<xsl:call-template name="do-blue-tangram">
<xsl:with-param name="transforms" select="$tangram-transforms"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:message>Don't know how to deal with figure "<xsl:value-of select="$next-figure"/>".</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>@
Please register to edit this issue
Also available in: Atom PDF Tracking page