Project

Profile

Help

Support #1832 ยป test-is.xsl

Lars Huttar, 2013-06-25 16:35

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="myns"
version="2.0">
<xsl:template match="/">
test1: <xsl:value-of select="fn:report(/* is /*)"/> <!-- true -->
test2: <xsl:value-of select="fn:report(/* is /*/*[1])"/> <!-- false -->
test3: <xsl:value-of select="fn:report(/* is /..)"/> <!-- should throw error, but doesn't. -->
test4: <xsl:value-of select="fn:report(/* is /*/*)"/> <!-- should throw error, and does. -->
</xsl:template>
<xsl:function name="fn:report">
<xsl:param name="val"/>
<xsl:value-of select="if (empty($val)) then 'Value is an empty sequence.'
else concat('Value is: ', $val)"/>
</xsl:function>
</xsl:stylesheet>
    (1-1/1)