Like database sorting, XSL/XSLT can also implement random sorting. The principle is also very simple. The following is the code.
<?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>