欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

在 XSL/XSLT 中實(shí)現(xiàn)隨機(jī)排序

 更新時(shí)間:2006年10月11日 00:00:00   作者:  

和數(shù)據(jù)庫排序一樣,XSL/XSLT也可以實(shí)現(xiàn)隨機(jī)排序,原理也很簡單,下面就是代碼。

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  xmlns:eMeng="http://dotnet.aspx.cc/"
  version="1.0">
<msxsl:script language="JavaScript" implements-prefix="eMeng">
 function Random() {
  return Math.random();
 }
</msxsl:script>

<xsl:template match="/">
<xsl:for-each select="/*/node()">
<xsl:sort select="eMeng:Random()"/>
<xsl:value-of select="."/>
<br/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

相關(guān)文章

最新評(píng)論