The TRANSFORM member function transforms XML data by using the XSL stylesheet argument and top-level parameters passed in name=value pairs. If any parameter other than parammap is NULL, NULL is returned.
If the input format of an XSL stylesheet is invalid or the conversion result is an invalid piece of XML text, OceanBase Database returns the XSL stylesheet itself.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Syntax
MEMBER FUNCTION TRANSFORM(
xsl IN XMLType)
RETURN XMLType;
Parameters
| Parameter | IN/OUT | Description |
|---|---|---|
| xsl | (IN) | The XSL stylesheet describing the transformation. |
| parammap | (IN) | The top-level parameters of XSL, in name=value pairs. |
Examples
The following example shows the content returned for the XMLType variable a upon TRANSFORM conversion. The XMLType 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/>