ownerTemplate Property

 

Returns the style sheet template that was used to create IXSLProcessor.

var objXSLTemplate = objXSLProcessor.ownerTemplate;  

Example

This JScript example uses the 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;
xslDoc.load("sample2.xsl");
if (xslDoc.parseError.errorCode != 0) {
   var myErr = xslDoc.parseError;
   WScript.Echo("You have error " + myErr.reason);
} else {
   xslt.stylesheet = xslDoc;
   xslProc = xslt.createProcessor();
   WScript.Echo(xslProc.ownerTemplate.stylesheet.xml);
}

Set objXSLTemplate = objXSLProcessor.ownerTemplate  

The Jscript example listed above 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>

HRESULT get_ownerTemplate (IXSLTemplate** ppTemplate);  

Parameters

ppTemplate[out, retval]
The returned style sheet template property.

The processor keeps the template active, so even if the user releases the template, this property can still be used to return the original template object.

System_CAPS_ICON_note.jpg Note

The stylesheet property on the returned template may be different from the stylesheet property.

Implemented in:

MSXML 3.0, MSXML 6.0

IXSLProcessor

Show: