setStartMode Method
Performs subsets of larger XSL Transformations (XSLT) by selecting the XSLT mode with which to start. This minimizes the amount of XSLT processing.
The default value of the start mode is the empty string, "".
objXSLProcessor.setStartMode(mode, namespaceURI);
Parameters
Example
var xslt = new ActiveXObject("Msxml2.XSLTemplate.6.0"); var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.6.0"); var xslProc; xslDoc.async = false; xslDoc.load("sample2.xsl"); xslt.stylesheet = xslDoc; var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0"); xmlDoc.async = false; xmlDoc.load("books.xml"); xslProc = xslt.createProcessor(); xslProc.input = xmlDoc; xslProc.setStartMode("view"); xslProc.transform(); WScript.Echo(xslProc.output);
The JScript example uses the following file.
Sample2.xsl
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html"/> <xsl:param name="param1"/> <xsl:template match="/"> Hello </xsl:template> <xsl:template match="/" mode="edit"> In Edit Mode </xsl:template> <xsl:template match="/" mode="view"> In View Mode </xsl:template> </xsl:stylesheet>