XSLTransformation - cXMLDOMDocumentFragment

Processes the node of the object receiving the message and all its children using the XSL stylesheet document passed, and returns the resulting transformation as a string

Type: Function

Return Data Type: String

Parameters: Handle hoXSLDocument

ParameterDescription
hoXSLDocumentHandle to XSL document which will be used in the transformation


Return Value

Returns an XML string created by the transformation


Syntax
Function XSLTransformation Handle hoXSLDocument Returns String

Call: Get XSLTransformation hoXSLDocument to StringVariable


Description

XSLTransformation processes the node of the object receiving the message and all its children using the XSL stylesheet document passed, and returns the resulting transformation as a string.

The XSL stylesheet is passed as either an XML document (since XSL stylesheets are XML files) or as an XSL node. In either case the XSL transformation is applied to the object that receives the message. If this object is the XML root node (the document element), the entire XML document will be transformed.

The XSL stylesheet and the transformation uses "standard" XSL processing rules as defined by Microsoft's IE5 XMLDOM parser. Transformations can be used to transform XML to any type of format (e.g. another XML document; an HTML or an XHTML document; simple text, or whatever). The XSL stylesheet, which is itself an XML document, determines how the transformation will be applied.

Example

// Create and load the XML document
Get Create U_cXMLDOMDocument to hoXML
Set psDocumentName of hoXML to (sPath - "\customer.xml")
Get LoadXMLDocument of hoXML to bOK

// Create and load the XSL document
Get Create U_cXMLDOMDocument to hoXSL
Set psDocumentName of hoXSL to (sPath - "\customer.xsl")
Get LoadXMLDocument of hoXSL to bOK

// Transform the XML document using the XSL document as the stylesheet
// return the value as a string to sData
// Get DocumentElement of hoXML to hoRoot

Get XSLTransformation of hoXML hoXSL to sData
 
Send Destroy of hoXSL
Send Destroy of hoXML

If the returned XML string is very large (larger than the allowed string size) you may wish to use the XSLTransformationToAddress method.

See Also

XSLTransformationToAddress