The TRANSFORM member function uses an XSL stylesheet and parameters (name=value) to convert XML data. If any parameter other than parammap is NULL, the function returns NULL.
If the XSL stylesheet input is invalid or the conversion result is invalid XML text, OceanBase Database returns the XSL stylesheet itself.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
MEMBER FUNCTION TRANSFORM(
xsl IN XMLType)
RETURN XMLType;
Parameters
| Parameter | IN / OUT | Description |
|---|---|---|
| xsl | (IN) | The XSL stylesheet to be converted. |
| parammap | (IN) | The top-level parameters of XSL, that is, name=value. |
Examples
The following example demonstrates the content of the XMLType variable a after it is converted by TRANSFORM. The variable xlt is a valid XSL stylesheet.
obclient> DECLARE
xlt XMLType := xmltype('<?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"><document></document></xsl:template></xsl:stylesheet>');
a XMLType;
BEGIN
a:=xmltype('<a>123</a>');
DBMS_OUTPUT.PUT_LINE('Before transform: ' ||a.getstringval());
a:=a.transform(xlt);
DBMS_OUTPUT.PUT_LINE('After transform' ||a.getstringval());
END;
/
Query OK, 0 rows affected
Before transform: <a>123</a>
After transform<document/>
