Transforming XMLTypes

The XMLType.transform() or XMLTransform() function can be used to transform XMLTypes. The XSL transformation conforms to the W3C XSLT 1.0 standard. The following example transforms an XMLType by removing data from reports. The XSL stylesheet is shown as follows (public_ view.xsl):

<?xml version=“1.0” encoding=“windows-1252” ?>

<xsl:stylesheet version=“2.0” xmlns:xsl=“http://www.w3.org/1999/XSL/Transform”

xmlns=“http://xmlbook.com/sample/contact.xsd”>

          <xsl:template match=“*” priority=“2”>

                    <xsl:if test=“local-name()!=‘category’”>

                    <xsl:element name=“{local-name()}” namespace=“http://xmlbook.com/sample/ contact.xsd” >

                         <xsl:apply-templates select=“@*|node()” ...

Get Oracle Database 11g Building Oracle XML DB Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.