html怎么往xsl里传参数,用来动态应用xsl
html:
<script type="text/javascript"> var xml = new ActiveXObject("Microsoft.XMLDOM") xml.async = false xml.load("data.xml") var xsl = new ActiveXObject("Microsoft.XMLDOM") xsl.async = false xsl.load("view.xsl") document.write(xml.transformNode(xsl))</script><xsl:template match="/"> <xsl:choose> <xsl:when test="$mode = a"> <xsl:apply-templates select="." mode="a"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="." mode="b"/> </xsl:otherwise> </xsl:choose> </xsl:template><xsl:template match="/" mode="a"></xsl:template><xsl:template match="/" mode="b"></xsl:template>