Boolean context store value not handled correctly in transformation parameter

When a context store type is boolean, the value is not handled correctly when the context store is used in a transformation as a parameter.

If you pass an actual boolean value to the transform you have compare it with a boolean value, not with a string.

Original xlst:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
	xmlns:AS="http://schema.advantages.cz/AsapFunctions"
	xmlns:date="http://exslt.org/dates-and-times" exclude-result-prefixes="AS date">

	<xsl:param name="boolean"/>

	<xsl:template match="ROOT">
		<ROOT>
			<value>
				<xsl:choose>
					<xsl:when test="$boolean = 'false'">test_false</xsl:when>
					<xsl:otherwise>test_true</xsl:otherwise>
				</xsl:choose>
			</value>
		</ROOT>
	</xsl:template>
</xsl:stylesheet>

Fixed xslt:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
	xmlns:AS="http://schema.advantages.cz/AsapFunctions"
	xmlns:date="http://exslt.org/dates-and-times" exclude-result-prefixes="AS date">

	<xsl:param name="boolean"/>

	<xsl:template match="ROOT">
		<ROOT>
			<value>
				<xsl:choose>
					<xsl:when test="$boolean = false()">test_false</xsl:when>
					<xsl:otherwise>test_true</xsl:otherwise>
				</xsl:choose>
			</value>
		</ROOT>
	</xsl:template>
</xsl:stylesheet>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.