input Property
Specifies which XML input tree to transform.
[Script]
Script Syntax
var objXMLDOMNode = objXSLProcessor.input;
objXMLDOMXSLProcessor.input = objXMLDOMNode;
Example
var xslt = new ActiveXObject("Msxml2.XSLTemplate.4.0");
var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0");
var xslProc;
xslDoc.async = false;
xslDoc.load("sample2.xsl");
xslt.stylesheet = xslDoc;
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
xmlDoc.async = false;
xmlDoc.load("books.xml");
xslProc = xslt.createProcessor();
xslProc.input = xmlDoc;
xslProc.transform();
alert(xslProc.output);
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
Set objXMLDOMNode = objXSLProcessor.input
objXMLDOMXSLProcessor.input = objXMLDOMNode
Example
Dim xslt As New Msxml2.XSLTemplate40
Dim xslDoc As New Msxml2.FreeThreadedDOMDocument40
Dim xmlDoc As New Msxml2.DOMDocument40
Dim xslProc As IXSLProcessor
xslDoc.async = False
xslDoc.Load "sample2.xsl"
Set xslt.stylesheet = xslDoc
xmlDoc.async = False
xmlDoc.Load "books.xml"
Set xslProc = xslt.createProcessor()
xslProc.input = xmlDoc
xslProc.Transform
MsgBox xslProc.output
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_input (VARIANT * pVar);
HRESULT put_input (VARIANT pVar);
Parameters
- pVar [out, retval][in]
- The input XML to which to apply the transformation. This can be a URL (string/BSTR), a DOMDocument object, an IXMLDOMNode or any object that supports ISequentialStream, IStream, orIPersistStream. If applying the transformation to an IXMLDOMNode, any node type and any threading model can be specified. If this argument is Null, the existing input will be cleared.
C/C++ Return Values
- E_FAIL
- The value returned if readyState is READYSTATE_INTERACTIVE.
- E_INVALIDARG
- The value returned if the variant is not VT_DISPATCH or VT_UNKNOWN.
- E_NOINTERFACE
- The value returned if the argument does not support IStream or IXMLDOMNode.
Remarks
Setting this property resets the state of the processor.
To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button
in the upper-left corner of the page.
See Also
Applies to: IXSLProcessor