XSL中几个封装的函数
总结了XSL中几个封装的函数,供大家参考查阅!
布尔操作函数
< !-- ======================================================== -->
< !-- Function: BooleanOR(< value1>,< value2>) => number -->
< !-- Parameters:- -->
< !-- < value1> - the first number to be ORed -->
< !-- < value2> - the second number to be ORed -->
< !-- NB. Only works with unsigned ints! -->
< xsl:template name="BooleanOR">
< xsl:param name="value1" select="number(0)"/>
< xsl:param name="value2" select="number(0)"/>
< !-- recurse parameters -->
< xsl:param name="bitval" select="number(2147483648)"/>
< xsl:param name="accum" select="number(0)"/>
< !-- calc bits present on values -->
< xsl:variable name="bit1" select="floor($value1 div $bitval)"/>
< xsl:variable name="bit2" select="floor($value2 div $bitval)"/>
< !-- do the OR on the bits -->
< xsl:variable name="thisbit">
< xsl:choose>
< xsl:when test="($bit1 != 0) or ($bit2 != 0)">< xsl:value-of select="$bitval"/>< /xsl:when>
< xsl:otherwise>0< /xsl:otherwise>
< /xsl:choose>
< /xsl:variable>
- 本文关键词:

