|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Re: XPath 2.0: Problems with the two boolean const
>
> I am referring to the situation after the bug is corrected.
>
> Then, this template:
>
> <xsl:template name="And" match="test:*">
> <xsl:param name="arg1" as="xs:boolean"/>
> <xsl:param name="arg2" as="xs:boolean"/>
> <xsl:value-of
> select="$arg1 and $arg2"/>
> </xsl:template>
>
> when instantiated with:
>
> <xsl:apply-templates select="document('')/*/test:*[1]">
> <xsl:with-param name="arg1" select="'false'"/>
> <xsl:with-param name="arg2" select="'true'"/>
> </xsl:apply-templates>
>
> will raise an error, because the arguments are strings, but
> the parameters of the template are of type xs:boolean.
>
> Therefore, I am forced to remove the types for the parameters
> of the template and do the conversion myself:
>
> <xsl:template name="And" match="test:*">
> <xsl:param name="arg1"/>
> <xsl:param name="arg2"/>
> <xsl:value-of
> select="xs:boolean(xs:boolean($arg1) and
> xs:boolean($arg2))"/>
> </xsl:template>
Why not just call the template with boolean values?
<xsl:apply-templates select="document('')/*/test:*[1]">
<xsl:with-param name="arg1" select="false()"/>
<xsl:with-param name="arg2" select="true()"/>
</xsl:apply-templates>
Michael Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








