Project

Profile

Help

Bug #3069 » testCase.xsl

Main stylesheet - Axel Court, 2016-12-13 12:46

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:els="http://www.lefebvre-sarrut.eu/ns/els"
exclude-result-prefixes="#all"
version="2.0">

<xsl:include href="lotsOfFunctions.xsl"/>

<xsl:template name="testCase">
<xsl:param name="str1" select="'a'" as="xs:string"/>
<xsl:param name="str2" select="'b'" as="xs:string"/>
<xsl:sequence select="els:compare($str1,$str2)"/>
</xsl:template>
<xsl:function name="els:trans" as="xs:integer">
<xsl:param name="fctstr" as="xs:string"/>
<xsl:choose>
<xsl:when test="$fctstr = 'a'">1</xsl:when>
<xsl:when test="$fctstr = 'b'">2</xsl:when>
<xsl:when test="$fctstr = 'c'">3</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:function>
<xsl:function name="els:compare" as="xs:boolean">
<xsl:param name="fctstr1" as="xs:string"/>
<xsl:param name="fctstr2" as="xs:string"/>
<xsl:value-of select="boolean(els:trans($fctstr1) >= els:trans($fctstr2))"/>
</xsl:function>
</xsl:stylesheet>
(1-1/2)