Parameter | Description |
---|---|
hoXSLDocument | Handle to XSL document which will be used in the transformation |
Returns a pointer to the XML data that was created by the transformation
Function XSLTransformationToAddress Handle hoXSLDocument Returns Pointer
Call: | Get XSLTransformationToAddress hoXSLDocument to PointerVariable |
XSLTransformationToAddress processes the node of the object receiving the message and all its children using the XSL stylesheet document passed, places the transformation in heap memory and returns a pointer to that data. This message can be used to transform large documents (documents that are larger than allowed string length).
Data created by this transformation is often loaded into another XML document using the LoadXMLFromAddress method.
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.
Note: | This method requires that you dispose of the memory allocated by the transformation. You do this with the Free() function. |
Function TransformDocument handle hoOldXML handle hoXSL returns Handle Handle hoNewXML hoRoot Address aNewXml Boolean bOk Get DocumentElement of hoOldXML to hoRoot // Transform the XML document from the root // using the XSL document as the stylesheet // return the value as a memory pointer Get XSLTransformationToAddress of hoRoot hoXSL to aNewXml // Create and load the new XML document Get Create U_cXMLDOMDocument to hoNewXml Get LoadXMLFromAddress of hoNewXml aNewXml to bOk // remember to free the memory Move (Free(aNewXml)) to bOk // destroy the old root node Send Destroy of hoRoot // return new XML document function_return hoNewXml End_Function
XSLTransformationToAddress is normally only needed to transform very large documents (i.e., documents that may be larger than the maximum allowed string size.) For most transformations, you may use the XSLTransformation method to return the XML data as a string.