startModeURI Property

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - DOM Reference

startModeURI Property

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

[Script]

Script Syntax

strNamespace = objXSLProcessor.startModeURI;

Example

var xslt = new ActiveXObject("Msxml2.XSLTemplate.5.0");
var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.5.0");
var xslProc;
xslDoc.async = false;
xslDoc.load("sample2.xsl");
xslt.stylesheet = xslDoc;
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.5.0");
xmlDoc.async = false;
xmlDoc.load("books.xml");
if (xmlDoc.parseError.errorCode != 0) {
   var myErr = xmlDoc.parseError;
   alert("You have error " + myErr.reason);
} else {
   xslProc = xslt.createProcessor();
   xslProc.input = xmlDoc;
   xslProc.setStartMode("view");
   alert(xslProc.startModeURI);
}

File Name: 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>
[Visual Basic]

Visual Basic Syntax

strNamespace = objXSLProcessor.startModeURI

Example

Dim xslt As New Msxml2.XSLTemplate50
Dim xslDoc As New Msxml2.FreeThreadedDOMDocument50
Dim xmlDoc As New Msxml2.DOMDocument50
Dim xslProc As IXSLProcessor
xslDoc.async = False
xslDoc.Load "sample2.xsl"
If (xmlDoc.parseError.errorCode <> 0) Then
   Dim myErr
   Set myErr = xmlDoc.parseError
   MsgBox("You have error " & myErr.reason)
Else
   Set xslt.stylesheet = xslDoc
   xmlDoc.async = False
   xmlDoc.Load "books.xml"
   Set xslProc = xslt.createProcessor()
   xslProc.input = xmlDoc
   xslProc.setStartMode "view"
   MsgBox xslProc.startModeURI
End If

File Name: 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>
[C/C++]

C/C++ Syntax

HRESULT get_startModeURI(BSTR * namespaceURI);

Parameters

namespaceURI [out, retval]
The namespace URI of the starting Extensible Stylesheet Language (XSL) mode.

Remarks

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

To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

Applies to: IXSLProcessor

Other Resources Other Resources

Worldwide Web Consortium XSL Transformations (XSLT) Version 1.0 Recommendation