2.45 :transform()
This method transforms the object using a given schema. When the transformation target is an XML Document, the stored DOM tree is deleted and a new tree is built up. All existing XML Cursors become invalid.
Alternatively, the transformation target may be a text or a file. If the transformation produces no legal XML format, its immediate result must be a text or a file, because the result cannot be assigned to an XML Document. This applies for transformations to HTML, for example.
Definition
boolean :transform ( object Schema input { , anyvalue Target := null input output } { , enum Type := type_object input } )
Parameters
- object Schema input
- The XSLT document that defines the transformation rules. The parameter must be an XML Document.
- anyvalue Target := null input output
-
Optional parameter that specifies the target of the transformation. When the parameter is missing, the this object is taken as target. This parameter may have one of these data types:
- object Target input
- Target is an input parameter representing an XML Document. The stored DOM tree is deleted and a new tree is built up in accordance with the transformation.
- string Target input output
- Depending on the Type parameter, Target is either an input parameter that specifies a file name or an output parameter that contains the string resulting from the transformation.
- enum Type := type_object input
-
Optional parameter that defines the transformation type.
- type_file
- The Target parameter is a file.
- type_object
- The Target parameter is an XML Document. This is the default value when the Target parameter has the data type object.
- type_text
- The Target parameter is an output parameter with data type string. This is the default value when the Target parameter has the data type string.
Return value
The method returns true after a successful transformation, false if the transformation failed.
In case of an error, the DOM tree of the XML Document passed in Target either remains unchanged or is deleted completely; there will never be a partial transformation.
Objects with this method