startModeURI Property


Returns the namespace URI part of the start mode, the qualified name.

strNamespace = objXSLProcessor.startModeURI;

This Jscript example uses a resource file, sample2.xsl, listed later in this topic.

var xslt = new ActiveXObject("Msxml2.XSLTemplate.3.0");
var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0");
var xslProc;
xslDoc.async = false;
xslt.stylesheet = xslDoc;
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
xmlDoc.async = false;
if (xmlDoc.parseError.errorCode != 0) {
   var myErr = xmlDoc.parseError;
   WScript.Echo("You have error " + myErr.reason);
} else {
   xslProc = xslt.createProcessor();
   xslProc.input = xmlDoc;

strNamespace = objXSLProcessor.startModeURI

The Jscript example uses the following resource file.


<xsl:stylesheet xmlns:xsl="" version="1.0">
   <xsl:output method="html"/>
   <xsl:param name="param1"/>
  <xsl:template match="/">
  <xsl:template match="/" mode="edit">
      In Edit Mode
  <xsl:template match="/" mode="view">
      In View Mode

HRESULT get_startModeURI(BSTR * namespaceURI);

 namespaceURI[out, retval]

The namespace URI of the starting Extensible Stylesheet Language (XSL) mode.

The default value of this property is the empty string, "".

By default, the starting mode for a new XSLT stylesheet is NULL and the startModeURI property returns the empty string ("") as its initial value. However, a user can use this property to read or change this value, which will set the namespace prefix to be applied to the base name specified in the startMode property. Together, these two values form a QName that can identify a starting mode. The start mode works in connection with the mode attribute of xsl:template instructions. All templates with the same mode are grouped together. The xsl:apply-templates instruction also has a mode attribute that allows it to match and apply only those templates with the same mode.

For more information, see the Worldwide Web Consortium XSL Transformations (XSLT) Version 1.0 Recommendation at

Implemented in:

MSXML 3.0, MSXML 6.0