Microsoft XML SDK 2.6 - XML Reference

IXMLDOMNode::transformNode Method

Processes this node and its children using the supplied XSL style sheet and returns the resulting transformation.

Visual Basic Syntax

strValue = oXMLDOMNode.transformNode(objStylesheet)

C/C++ Syntax

HRESULT transformNode(
    IXMLDOMNode *stylesheet,
    BSTR *xmlString);

Parameters

stylesheet [in]
Valid XML document or DOM node that consists of XSLT elements that direct the transformation of this node.
xmlString [out]
String that contains the product of the transformation of this XML document based on the XSLT style sheet.

C/C++ Return Values

S_OK
Value returned if successful.
E_INVALIDARG
Value returned if stylesheet or xmlString is Null.

Remarks

The stylesheet parameter must be either an IXMLDOMDocument node, in which case the document is assumed to be an XSL style sheet, or a DOM node in the XSL style sheet, in which case this node is treated as a stand-alone style sheet fragment.

The source node defines a context for the style sheet to operate on, but navigation outside this scope is allowed. For instance, a style sheet could use the id function to access other parts of the document.

This method supports both stand-alone and embedded style sheets and also provides the ability to run a localized style sheet fragment against a particular source node.

For more information about XSLT style sheets, see the XSLT Reference.

See Also

IXMLDOMNode Interface | Using the XSLT Processor