|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: junit test... for xslt2?
> <!-- Integer compare --> > <xsl:function name="d:int-cmp" as="xs:boolean"> > <xsl:param name="n1" as="xs:integer"/> > <xsl:param name="n2" as="xs:integer"/> > <xsl:choose> > <xsl:when test="$n1 = $n2"> > <xsl:value-of select="true()"/> > </xsl:when> > <xsl:otherwise> > <xsl:value-of select="false()"/> > </xsl:otherwise> > </xsl:choose> > </xsl:function> Out of interest, why would you want to use a function... what does d:int-cmp($int1, $int2) give you over "$int1 eq $int2" ? That aside, it's also worth using xsl:sequence rather than value-of to return an atomic, to avoid the text node creation and atomisation. And the choose can be compacted down to xsl:sequence select="$n1 eq $n2". -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/
|
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








