Microsoft XML SDK 2.6 - XML Reference

IXSLProcessor::output Method

IXSLProcessor::get_output Method

Used to get a custom output object to which to write the result of the transformation.

Visual Basic Syntax

objXSLProcessor.output(objoutput)

C/C++ Syntax

HRESULT get_output (VARIANT* pOutput);

Parameters

pOutput [out]
The custom output object or a BSTR containing the transformation result.

C/C++ Return Values

E_NOINTERFACE
Value returned if the given output object doesn’t support a supported interface.
E_FAIL
Value returned if readyState is READYSTATE_INTERACTIVE.

Remarks

When a new transformation is started, the processor will QueryInterface this output object for a new IStream interface. When the transformation is complete or when you call reset, this interface is released. The only method that is used on the IStream interface is Write. The bytes written to the stream are encoded according to the encoding attribute on the <xsl:output> element.

If you don’t provide a custom output object, a BSTR is returned when you read the output property that contains the incrementally buffered transformation result. Reading this property has the side effect of resetting that internal buffer, so that each time you read the property you get the next chunk of output. In this case, the output is always generated in Unicode encoding, and the encoding attribute on the <xsl:output> element is ignored.

You cannot change the output object midway through a transformation.



IXSLProcessor::put_output Method

Used to provide a custom output object to write the result of the transformation to. This can be any object that supports IStream, IPersistStream, IXMLDOMDocument, ASP IResponse, or ADODB.Stream.

Visual Basic Syntax

objXSLProcessor.output(output)

C/C++ Syntax

HRESULT put_output (VARIANT pOutput);

Parameters

pOutput [in]
The object to write the output of the transformation to.

C/C++ Return Values

E_NOINTERFACE
Value returned if the given output object doesn’t support a supported interface.
E_FAIL
Value returned if readyState is READYSTATE_INTERACTIVE.

Remarks

When a new transformation is started, the processor will QueryInterface this output object for a new IStream interface. When the transformation is complete or when you call reset, this interface is released. The only method that is used on the IStream interface is Write. The bytes written to the stream are encoded according to the encoding attribute on the <xsl:output> element.

If you don’t provide a custom output object, a BSTR is returned when you read the output property that contains the incrementally buffered transformation result. Reading this property has the side effect of resetting that internal buffer, so that each time you read the property you get the next chunk of output. In this case, the output is always generated in Unicode encoding, and the encoding attribute on the <xsl:output> element is ignored.

You cannot change the output object midway through a transformation.

See Also

Examples

IXSLProcessor Interface