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

readyState Property (IXSLProcessor)

Returns the current state of the processor.

[Script]

Script Syntax

lReadyState = objXSLProcessor.readyState;

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();
   alert(xslProc.readyState);
   xslProc.input = xmlDoc;
   alert(xslProc.readyState);
}
[Visual Basic]

Visual Basic Syntax

lReadyState = objXSLProcessor.readyState

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()
   MsgBox xslProc.readyState
   xslProc.input = xmlDoc
   MsgBox xslProc.readyState
End If
[C/C++]

C/C++ Syntax

HRESULT readyState (long* pReadyState);

Parameters

pReadyState [out, retval]
The state of the current transformation.

Remarks

The readyState property returns the current state of the processor as follows.

State Description
READYSTATE_UNINITIALIZED (0) This is the initial state until all the required properties (in particular, the input property) are set. Calling the transform method at this point returns an error.
READYSTATE_LOADING (1) Not used by IXSLProcessor.
READYSTATE_LOADED (2) This is the state in which all required properties are set. You can now call the transform method.
READYSTATE_INTERACTIVE (3) The transform method has been called, but is not finished yet. Not used by IXSLProcessor.
READYSTATE_COMPLETE (4) The transformation is finished, but there may still be some output to read if you are reading the output as a string.

When you call the reset method or set any property, it reverts to READYSTATE_LOADED. If a required property is cleared, it reverts to READYSTATE_UNINITIALIZED.

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