{ Frameless }

XSLT2Processor.setInitialTemplate()

The setInitialTemplate($name) function sets the initial template to be used.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
    xmlns:ns="http://ridiculo.us/">

  <xsl:param name="a" select="1"/>
  <xsl:param name="b" select="99"/>

  <xsl:template name="list">
    <ul>
      <xsl:for-each select="$a to $b">
        <li>
          <xsl:value-of select="."/>
        </li>
      </xsl:for-each>
    </ul>
  </xsl:template>

</xsl:stylesheet>
var xslt, list
xslt = new XSLT2Processor
xslt.setParameter("a", 7)
xslt.setParameter("b", 42)
xslt.setInitialTemplate("list")
xslt.importStylesheet("list.xsl")
list = xsl.transformToFragment(document)
document.body.appendChild(list)