The xsltransform function

Use this function to return a document up to 32,739 bytes.

Purpose

The xsltransform function transforms an XML document with an XSL stylesheet and XSLT parameter. The returned document is of type LVARCHAR.

The xsltransform syntax


1  xlstransform ( xml_document , xsl_document )

Parameters

xml_document
The XML document or fragment to transform. The document can be of type LVARCHAR, CLOB, or BLOB.
xsl_document
The XSL stylesheet document that is applied to the XML document. The XSL stylesheet can be of type LVARCHAR, CLOB, or BLOB.

Sample

Column info contains an XML document, and column style contains an XSL stylesheet:
Table 1. A row in table xmldocs
id info style
1 <?xml version='1.0' encoding='ISO-889–1' ?> <doc>Hello world!</doc> <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'> <xsl:output encoding='US-ASCII'/> <xsl:template match='doc'> <out> <xsl:value-of select='.'/> </out> </xsl:template> </xsl:stylesheet>
The XML document is transformed by the XSL stylesheet by calling xsltrasform:
select xsltransform(info, style) from xmldocs where id = 1
The following XML document is returned:
<?xml version='1.0' encoding="US-ASCII"?> <out>Hello world!</out>