CTOCIO IT专家网

天极传媒 比特网 | 天极网 | IT专家网 | IT商网 | 52PK游戏网 | 手机天极 | IT分众 |
IT专家网搜索

您现在的位置: IT专家网 > Web服务子站 > .NET技术

XSL中几个封装的函数

作者: 佚名,  出处:IT专家网论坛, 责任编辑: 包春林, 
2008-06-02 04:00
  总结了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>

共5页。 1 2 3 4 5 :

网友评论

笔名 
请您注意:遵守国家有关法律、法规,尊重网上道德,承担一切因您的行为而直接或间接引起的法律责任。    IT专家网友拥有管理笔名和留言的一切权利。
  • 周排行榜
  • 月排行榜

邮件订阅

       
天极服务 | 关于我们 | 网站律师 | 加入我们 | 联系我们 | 广告业务 | 友情链接 | 我要挑错
All Rights Reserved, Copyright 2004-2008, Ctocio.com.cn
渝ICP证B2-20030003号 如有意见请与我们联系 powered by 天极内容管理平台CMS4i