文章詳情頁
在 XSL/XSLT 中實現(xiàn)隨機排序
瀏覽:280日期:2022-06-03 13:32:03
和數(shù)據(jù)庫排序一樣,XSL/XSLT也可以實現(xiàn)隨機排序,原理也很簡單,下面就是代碼。
<?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>
標簽:
XML/RSS
上一條:用XML和XSL來生成動態(tài)頁面下一條:XMLHTTP資料
相關文章:
1. 基于android studio的layout的xml文件的創(chuàng)建方式2. 解決Android studio xml界面無法預覽問題3. 詳解Android studio 動態(tài)fragment的用法4. 圖文詳解vue中proto文件的函數(shù)調用5. 什么是python的自省6. Spring Boot和Thymeleaf整合結合JPA實現(xiàn)分頁效果(實例代碼)7. Android如何加載Base64編碼格式圖片8. 使用Android studio查看Kotlin的字節(jié)碼教程9. Vuex localStorage的具體使用10. Vue封裝一個TodoList的案例與瀏覽器本地緩存的應用實現(xiàn)
排行榜

網公網安備