MINI MINI MANI MO

Path : /opt/oracle/product/18c/dbhomeXE/rdbms/xml/xsl/
File Upload :
Current File : //opt/oracle/product/18c/dbhomeXE/rdbms/xml/xsl/kumodtab.xsl

<?xml version="1.0"?>
<!-- 

 Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.

NAME
    kumodtab.xsl
DESCRIPTION
    XSLT stylesheet for MODIFY of TABLE_T objects
NOTES
    Do NOT modify this file under any circumstance. Copy the file
    if you wish to use this stylesheet with an external XML/XSL parser

MODIFIED        MM/DD/YY
    rapayne     06/29/17 - Bug 25690298 allow IND_SPARE4 to modify PART_OBJ/PARTOBJ/DEFPARAMETERS
    tbhukya     02/04/15 - Bug 19812662: Substitute with double quote 
                           in IND_SPARE4
    lbarton     04/22/14 - bug 18374198: default on null
    lbarton     03/13/14 - bug 18391893: REMAP_CONSTRAINT_NAME
    tbhukya     12/04/13 - Bug 13770504: add support for UPGRADE_V10_XMLTYPE
                           transform.
    lbarton     09/24/13 - bug 17236189: IND_SPARE4 parse item and transform
                           param
    bwright     08/16/13 - Bug 17312600: Remove hard tabs from DP src code
    lbarton     03/14/13 - bug 14705313: IN_TSNUM transform
    rapayne     02/28/13 - bug 16408811: backout cdata workaround - it is now
                           fixed in lpx.
    lbarton     12/19/12 - bug 14202396: implement REMAP_COLUMN_NAME in MODIFY
                           transform
    rapayne     08/05/12 - bug 13811951: ensure that cdata end-delimiters
                           remain escaped.
    sdavidso    12/15/11 - bug 13506555: remove virtual col schema remap
    lbarton     10/26/11 - REMAP_IND_TABLESPACE
    lbarton     09/30/11 - bug 12998372: REMAP_LOB_TABLESPACE, etc.
    tbhukya     08/04/11 - Bug 12632066: Remap_schema with virtual column 
                           expression table.
    lbarton     04/13/11 - bug 12346384: no relational operator exporting view
                           as table
    lbarton     05/28/10 - bug 9571727: remap dpapiversion, force_lob_be,
                           force_no_encrypt
    ebatbout    04/07/09 - 7229037: Add CHARSET, NCHARSET, Column length, and
                           Column character set id templates
    lbarton     01/26/06 - REMAP_NAME
    lbarton     11/02/05 - Bug 4715313: reformat files for use with XMLSpy 
    lbarton     07/10/02 - lbarton_mdapi_modify_transform
    lbarton     06/07/02 - Created
 -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 <!-- Import required scripts -->
 <xsl:import href="kumodcom.xsl"/>
 <xsl:import href="kumodts.xsl"/>
 <!-- Top-level parameters -->
 <xsl:param name="OBJECT_ROW1">0</xsl:param>
 <xsl:param name="OBJECT_ROW2">0</xsl:param>
 <xsl:param name="OBJECT_ROW3">0</xsl:param>
 <xsl:param name="OBJECT_ROW4">0</xsl:param>
 <xsl:param name="OBJECT_ROW5">0</xsl:param>
 <xsl:param name="OBJECT_ROW6">0</xsl:param>
 <xsl:param name="OBJECT_ROW7">0</xsl:param>
 <xsl:param name="OBJECT_ROW8">0</xsl:param>
 <xsl:param name="OBJECT_ROW9">0</xsl:param>
 <xsl:param name="OBJECT_ROW10">0</xsl:param>
 <xsl:param name="REMAP_SCHEMAO1" select="''"/>
 <xsl:param name="REMAP_SCHEMAN1" select="''"/>
 <xsl:param name="REMAP_SCHEMAO2" select="''"/>
 <xsl:param name="REMAP_SCHEMAN2" select="''"/>
 <xsl:param name="REMAP_SCHEMAO3" select="''"/>
 <xsl:param name="REMAP_SCHEMAN3" select="''"/>
 <xsl:param name="REMAP_SCHEMAO4" select="''"/>
 <xsl:param name="REMAP_SCHEMAN4" select="''"/>
 <xsl:param name="REMAP_SCHEMAO5" select="''"/>
 <xsl:param name="REMAP_SCHEMAN5" select="''"/>
 <xsl:param name="REMAP_SCHEMAO6" select="''"/>
 <xsl:param name="REMAP_SCHEMAN6" select="''"/>
 <xsl:param name="REMAP_SCHEMAO7" select="''"/>
 <xsl:param name="REMAP_SCHEMAN7" select="''"/>
 <xsl:param name="REMAP_SCHEMAO8" select="''"/>
 <xsl:param name="REMAP_SCHEMAN8" select="''"/>
 <xsl:param name="REMAP_SCHEMAO9" select="''"/>
 <xsl:param name="REMAP_SCHEMAN9" select="''"/>
 <xsl:param name="REMAP_SCHEMAO10" select="''"/>
 <xsl:param name="REMAP_SCHEMAN10" select="''"/>
 <xsl:param name="REMAP_TABLESPACEO1" select="''"/>
 <xsl:param name="REMAP_TABLESPACEN1" select="''"/>
 <xsl:param name="REMAP_TABLESPACEO2" select="''"/>
 <xsl:param name="REMAP_TABLESPACEN2" select="''"/>
 <xsl:param name="REMAP_TABLESPACEO3" select="''"/>
 <xsl:param name="REMAP_TABLESPACEN3" select="''"/>
 <xsl:param name="REMAP_TABLESPACEO4" select="''"/>
 <xsl:param name="REMAP_TABLESPACEN4" select="''"/>
 <xsl:param name="REMAP_TABLESPACEO5" select="''"/>
 <xsl:param name="REMAP_TABLESPACEN5" select="''"/>
 <xsl:param name="REMAP_TABLESPACEO6" select="''"/>
 <xsl:param name="REMAP_TABLESPACEN6" select="''"/>
 <xsl:param name="REMAP_TABLESPACEO7" select="''"/>
 <xsl:param name="REMAP_TABLESPACEN7" select="''"/>
 <xsl:param name="REMAP_TABLESPACEO8" select="''"/>
 <xsl:param name="REMAP_TABLESPACEN8" select="''"/>
 <xsl:param name="REMAP_TABLESPACEO9" select="''"/>
 <xsl:param name="REMAP_TABLESPACEN9" select="''"/>
 <xsl:param name="REMAP_TABLESPACEO10" select="''"/>
 <xsl:param name="REMAP_TABLESPACEN10" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEO1" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEN1" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEO2" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEN2" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEO3" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEN3" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEO4" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEN4" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEO5" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEN5" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEO6" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEN6" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEO7" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEN7" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEO8" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEN8" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEO9" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEN9" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEO10" select="''"/>
 <xsl:param name="REMAP_TABLE_TABLESPACEN10" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEO1" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEN1" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEO2" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEN2" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEO3" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEN3" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEO4" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEN4" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEO5" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEN5" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEO6" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEN6" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEO7" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEN7" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEO8" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEN8" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEO9" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEN9" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEO10" select="''"/>
 <xsl:param name="REMAP_LOB_TABLESPACEN10" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEO1" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEN1" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEO2" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEN2" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEO3" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEN3" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEO4" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEN4" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEO5" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEN5" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEO6" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEN6" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEO7" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEN7" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEO8" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEN8" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEO9" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEN9" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEO10" select="''"/>
 <xsl:param name="REMAP_PART_TABLESPACEN10" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEO1" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEN1" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEO2" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEN2" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEO3" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEN3" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEO4" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEN4" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEO5" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEN5" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEO6" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEN6" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEO7" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEN7" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEO8" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEN8" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEO9" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEN9" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEO10" select="''"/>
 <xsl:param name="REMAP_SPART_TABLESPACEN10" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEO1" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEN1" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEO2" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEN2" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEO3" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEN3" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEO4" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEN4" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEO5" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEN5" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEO6" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEN6" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEO7" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEN7" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEO8" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEN8" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEO9" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEN9" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEO10" select="''"/>
 <xsl:param name="REMAP_IND_TABLESPACEN10" select="''"/>
 <xsl:param name="REMAP_NAMEO1" select="''"/>
 <xsl:param name="REMAP_NAMEN1" select="''"/>
 <xsl:param name="REMAP_NAMEO2" select="''"/>
 <xsl:param name="REMAP_NAMEN2" select="''"/>
 <xsl:param name="REMAP_NAMEO3" select="''"/>
 <xsl:param name="REMAP_NAMEN3" select="''"/>
 <xsl:param name="REMAP_NAMEO4" select="''"/>
 <xsl:param name="REMAP_NAMEN4" select="''"/>
 <xsl:param name="REMAP_NAMEO5" select="''"/>
 <xsl:param name="REMAP_NAMEN5" select="''"/>
 <xsl:param name="REMAP_NAMEO6" select="''"/>
 <xsl:param name="REMAP_NAMEN6" select="''"/>
 <xsl:param name="REMAP_NAMEO7" select="''"/>
 <xsl:param name="REMAP_NAMEN7" select="''"/>
 <xsl:param name="REMAP_NAMEO8" select="''"/>
 <xsl:param name="REMAP_NAMEN8" select="''"/>
 <xsl:param name="REMAP_NAMEO9" select="''"/>
 <xsl:param name="REMAP_NAMEN9" select="''"/>
 <xsl:param name="REMAP_NAMEO10" select="''"/>
 <xsl:param name="REMAP_NAMEN10" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEO1" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEN1" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEO2" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEN2" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEO3" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEN3" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEO4" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEN4" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEO5" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEN5" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEO6" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEN6" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEO7" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEN7" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEO8" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEN8" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEO9" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEN9" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEO10" select="''"/>
 <xsl:param name="REMAP_CONSTRAINT_NAMEN10" select="''"/>
 <xsl:param name="OVERRIDE_CHARSET">0</xsl:param>
 <xsl:param name="OVERRIDE_NCHARSET">0</xsl:param>
 <xsl:param name="OVERRIDE_CHARLENGTH">0</xsl:param>
 <xsl:param name="OVERRIDE_CHARSETNAME" select="''"/>
 <xsl:param name="OVERRIDE_NCHARSETNAME" select="''"/>
 <xsl:param name="DPAPIVERSION">0</xsl:param>
 <xsl:param name="FORCE_LOB_BE">0</xsl:param>
 <xsl:param name="FORCE_NO_ENCRYPT">0</xsl:param>
 <xsl:param name="VIEW_AS_TABLE">0</xsl:param>
 <xsl:param name="IN_TSNUM" select="''"/>
 <!-- Params for column name remapping -->
 <xsl:param name="REMAP_COLUMN_NAMEO1" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEN1" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEO2" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEN2" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEO3" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEN3" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEO4" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEN4" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEO5" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEN5" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEO6" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEN6" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEO7" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEN7" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEO8" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEN8" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEO9" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEN9" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEO10" select="''"/>
 <xsl:param name="REMAP_COLUMN_NAMEN10" select="''"/>
 <!-- Parameter for upgrading xmltype -->
 <xsl:param name="UPGRADE_V10_XMLTYPE">0</xsl:param>
 <xsl:param name="IND_SPARE4" select="''"/>
 <xsl:param name="VERSION">9999999999</xsl:param>
 <!-- Templates -->
 <xsl:template match="TABLE_T">
  <xsl:copy>
   <xsl:if test="$VIEW_AS_TABLE=1">
    <xsl:element name="VIEW_AS_TABLE"/>
   </xsl:if>
   <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
 </xsl:template>
 <xsl:template match="MOWNER">
  <xsl:choose>
   <xsl:when test=".=$REMAP_SCHEMAO1">
    <MOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN1"/>
    </MOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO2">
    <MOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN2"/>
    </MOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO3">
    <MOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN3"/>
    </MOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO4">
    <MOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN4"/>
    </MOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO5">
    <MOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN5"/>
    </MOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO6">
    <MOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN6"/>
    </MOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO7">
    <MOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN7"/>
    </MOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO8">
    <MOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN8"/>
    </MOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO9">
    <MOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN9"/>
    </MOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO10">
    <MOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN10"/>
    </MOWNER>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="SOWNER">
  <xsl:choose>
   <xsl:when test=".=$REMAP_SCHEMAO1">
    <SOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN1"/>
    </SOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO2">
    <SOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN2"/>
    </SOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO3">
    <SOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN3"/>
    </SOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO4">
    <SOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN4"/>
    </SOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO5">
    <SOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN5"/>
    </SOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO6">
    <SOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN6"/>
    </SOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO7">
    <SOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN7"/>
    </SOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO8">
    <SOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN8"/>
    </SOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO9">
    <SOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN9"/>
    </SOWNER>
   </xsl:when>
   <xsl:when test=".=$REMAP_SCHEMAO10">
    <SOWNER>
     <xsl:value-of select="$REMAP_SCHEMAN10"/>
    </SOWNER>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="CHARSET">
  <!-- Template for changing the character set name -->
  <xsl:choose>
   <xsl:when test="$OVERRIDE_CHARSETNAME">
    <!-- replace the character set id for all character/clob columns -->
    <xsl:element name="CHARSET">
     <xsl:value-of select="$OVERRIDE_CHARSETNAME"/>
    </xsl:element>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="NCHARSET">
  <!-- Template for changing the national character set name -->
  <xsl:choose>
   <xsl:when test="$OVERRIDE_NCHARSETNAME">
    <!-- if specified, change the national character set  -->
    <xsl:element name="NCHARSET">
     <xsl:value-of select="$OVERRIDE_NCHARSETNAME"/>
    </xsl:element>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="COL_LIST/COL_LIST_ITEM/CHARSETID">
  <!-- Template for changing the char/nchar set id for all character columns -->
  <xsl:choose>
   <xsl:when test="../CHARSETFORM=1 and $OVERRIDE_CHARSET > 0">
    <!-- replace the character set id for all character/clob columns -->
    <xsl:element name="CHARSETID">
     <xsl:value-of select="$OVERRIDE_CHARSET"/>
    </xsl:element>
   </xsl:when>
   <!-- replace character set id for all national character/clob columns -->
   <xsl:when test="../CHARSETFORM=2 and $OVERRIDE_NCHARSET > 0">
    <xsl:element name="CHARSETID">
     <xsl:value-of select="$OVERRIDE_NCHARSET"/>
    </xsl:element>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="COL_LIST/COL_LIST_ITEM/LENGTH">
  <!-- Template for recalculating the length for a character column -->
  <xsl:choose>
   <xsl:when test="../CHARSETFORM=1 and $OVERRIDE_CHARSET > 0">
    <!-- recalculate the length for all character/clob columns.  The input
         variable, OVERRIDE_CHARLENGTH, contains the max width (in bytes)
         of a character for this new character set -->
    <xsl:element name="LENGTH">
     <xsl:value-of select="$OVERRIDE_CHARLENGTH * ../CHARLENGTH"/>
    </xsl:element>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="STRMTABLE_T/VERS_DPAPI">
  <!-- Set direct path API version in stream metadata -->
  <xsl:choose>
   <xsl:when test="$DPAPIVERSION != 0">
    <xsl:element name="VERS_DPAPI">
     <xsl:value-of select="$DPAPIVERSION"/>
    </xsl:element>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="STRMTABLE_T/COL_LIST/COL_LIST_ITEM[TYPE_NUM=112]/LOB_PROPERTY">
  <!-- optionally clear bi 0x0200 of lob_property, i.e., make the lob 
        appear big-endian -->
  <xsl:variable name="prop" select="."/>
  <xsl:choose>
   <xsl:when test="$FORCE_LOB_BE!=0 and (($prop mod 1024)>=512)">
    <xsl:element name="LOB_PROPERTY">
     <xsl:value-of select="$prop - 512"/>
    </xsl:element>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="STRMTABLE_T/COL_LIST/COL_LIST_ITEM/PROPERTY">
  <!-- optionally clear encryption bits in col$ property -->
  <xsl:variable name="prop" select="."/>
  <xsl:variable name="encr">67108864</xsl:variable>
  <xsl:variable name="encr_no_salt">536870912</xsl:variable>
  <xsl:choose>
   <xsl:when test="$FORCE_NO_ENCRYPT!=0 and 
      ((($prop mod ($encr * 2))>= $encr) or
       (($prop mod ($encr_no_salt * 2))>= $encr_no_salt))">
    <xsl:variable name="newprop">
     <xsl:call-template name="ForceNoEncrypt">
      <xsl:with-param name="oldprop" select="$prop"/>
     </xsl:call-template>
    </xsl:variable>
    <xsl:element name="PROPERTY">
     <xsl:value-of select="$newprop"/>
    </xsl:element>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <!-- For data stream metadata (STRMTABLE_T), when UPGRADE_V10_XMLTYPE is
      TRUE and there is at least one XMLTYPE column, drop the clob storage 
      column (COL_LIST_ITEM element) associated with each XMLTYPE column. 
      Also, add the OPQFLAGS element if it is missing.

      Background: In v10, tables with XMLTYPE columns are only supported when 
                  stored as CLOBs. OPQFLAGS element doesn't exist.  Beginning 
                  in V11, all storage options for XMLTYPE are supported, the
                  storage columns are not exported, and the OPQFLAGS element 
                  exists in the metadata. Export from V11 using VERSION=10, 
                  is like a V10 export, but will have the OPQFLAGS element, 
                  which will be ignored by V10 code.
   -->
 <xsl:template match="STRMTABLE_T/COL_LIST">
  <xsl:variable name="xcols" select="COL_LIST_ITEM[(TYPEMD/NAME='XMLTYPE' and
                           TYPEMD/OWNER_NAME = 'SYS')]"/>
  <xsl:choose>
   <!-- Transform if UPGRADE_V10_XMLTYPE is true and stream metadata
         has at least one xmltype column -->
   <xsl:when test="$UPGRADE_V10_XMLTYPE=1 and count($xcols)>=1">
    <xsl:copy>
     <xsl:for-each select="COL_LIST_ITEM">
      <xsl:choose>
       <!-- Background:
            A clob storage column is identified by:
              Type = 112 (CLOB) and
              Column is system generated (PROPERTY & 256) and
              Column COL_NUM matches an xmltype COLUMN

            An xmltype column is:
              Column type is 58 (Opaque) and
              Column is virtual (PROPERTY & 8) and
              Column is type name is XMLTYPE and
              Column is type owner is SYS
        -->
       <!-- Copy every clob column that is NOT associated with an
            XMLTYPE virtual column (thereby dropping each XMLTYPE's 
            storage CLOB column -->
       <xsl:when test="TYPE_NUM=112 and (PROPERTY mod 256) >= 128">
        <xsl:variable name="sx_clob" select="COL_NUM"/>
        <xsl:if test="not(../COL_LIST_ITEM[TYPE_NUM=58 and 
                               (PROPERTY mod 16) >= 8 and
                               TYPEMD/NAME = 'XMLTYPE' and
                               TYPEMD/OWNER_NAME = 'SYS' and
                               $sx_clob=COL_NUM])">
         <xsl:copy>
          <xsl:apply-templates select="@*|node()"/>
         </xsl:copy>
        </xsl:if>
       </xsl:when>
       <!-- Add element OPQFLAGS with value 4 (i.e. CLOB storage)
            for XMLTYPE virtual column which has no OPQFLAGS.
        -->
       <xsl:when test="TYPE_NUM=58 and
                      (PROPERTY mod 16) >= 8 and
                      TYPEMD/NAME = 'XMLTYPE' and
                      TYPEMD/OWNER_NAME = 'SYS' and
                      not (TYPEMD/OPQFLAGS)">
        <xsl:element name="COL_LIST_ITEM">
         <xsl:for-each select="child::*">
          <xsl:copy>
           <xsl:apply-templates/>
           <xsl:if test="name()='TYPEMD'">
            <xsl:element name="OPQFLAGS">
             <xsl:value-of select="4"/>
            </xsl:element>
           </xsl:if>
          </xsl:copy>
         </xsl:for-each>
        </xsl:element>
       </xsl:when>
       <xsl:otherwise>
        <xsl:copy>
         <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
       </xsl:otherwise>
      </xsl:choose>
     </xsl:for-each>
    </xsl:copy>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template name="ForceNoEncrypt">
  <!-- Utility template to clear encryption bits -->
  <xsl:param name="oldprop">0</xsl:param>
  <xsl:variable name="encr">67108864</xsl:variable>
  <xsl:variable name="encr_no_salt">536870912</xsl:variable>
  <xsl:choose>
   <xsl:when test="((($oldprop mod ($encr * 2))>= $encr) and
       (($oldprop mod ($encr_no_salt * 2))>= $encr_no_salt))">
    <xsl:value-of select="($oldprop - $encr) - $encr_no_salt"/>
   </xsl:when>
   <xsl:when test="(($oldprop mod ($encr * 2))>= $encr)">
    <xsl:value-of select="$oldprop - $encr"/>
   </xsl:when>
   <xsl:when test="(($oldprop mod ($encr_no_salt * 2))>= $encr_no_salt)">
    <xsl:value-of select="$oldprop - $encr_no_salt"/>
   </xsl:when>
  </xsl:choose>
 </xsl:template>
 <xsl:template name="replaceCharsInString">
  <!-- *******************************************************************
Template: replaceCharsInString 
Description: generic function to replace a specified string pattern
      with a specified replacement string
Parameters:
  stringIn    - source string
  charsIn    - substring pattern to be replaced
  charsOut - replacement string
Returns:  
     modified source string.
******************************************************************** -->
  <xsl:param name="stringIn"/>
  <xsl:param name="charsIn"/>
  <xsl:param name="charsOut"/>
  <xsl:choose>
   <xsl:when test="contains($stringIn,$charsIn)">
    <xsl:value-of select="concat(substring-before($stringIn,$charsIn),$charsOut)"/>
    <xsl:call-template name="replaceCharsInString">
     <xsl:with-param name="stringIn" select="substring-after($stringIn,$charsIn)"/>
     <xsl:with-param name="charsIn" select="$charsIn"/>
     <xsl:with-param name="charsOut" select="$charsOut"/>
    </xsl:call-template>
   </xsl:when>
   <xsl:otherwise>
    <xsl:value-of select="$stringIn"/>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="TABLE_T/COL_LIST/COL_LIST_ITEM/NAME">
  <!-- *******************************************************************
Template: TABLE_T/COL_LIST/COL_LIST_ITEM/NAME
 This is used to insert a REMAP_COLUMN_NAME element
 containing the desired new name.
******************************************************************** -->
  <xsl:choose>
   <xsl:when test="string-length($REMAP_COLUMN_NAMEO1)=0">
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:when>
   <xsl:otherwise>
    <xsl:call-template name="RemapColumnName">
     <xsl:with-param name="Val" select="."/>
    </xsl:call-template>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template name="RemapColumnName">
  <xsl:param name="Val"/>
  <!-- *******************************************************************
Template: RemapColumnName - common remap column name template
Parameters:
  Val  = current owner name value
 The existing element is left alone.  
 A new REMAP_COLUMN_NAME element is inserted with the remapped value.
******************************************************************** -->
  <xsl:choose>
   <xsl:when test="$Val=$REMAP_COLUMN_NAMEO1">
    <xsl:element name="REMAP_COLUMN_NAME">
     <xsl:value-of select="$REMAP_COLUMN_NAMEN1"/>
    </xsl:element>
   </xsl:when>
   <xsl:when test="$Val=$REMAP_COLUMN_NAMEO2">
    <xsl:element name="REMAP_COLUMN_NAME">
     <xsl:value-of select="$REMAP_COLUMN_NAMEN2"/>
    </xsl:element>
   </xsl:when>
   <xsl:when test="$Val=$REMAP_COLUMN_NAMEO3">
    <xsl:element name="REMAP_COLUMN_NAME">
     <xsl:value-of select="$REMAP_COLUMN_NAMEN3"/>
    </xsl:element>
   </xsl:when>
   <xsl:when test="$Val=$REMAP_COLUMN_NAMEO4">
    <xsl:element name="REMAP_COLUMN_NAME">
     <xsl:value-of select="$REMAP_COLUMN_NAMEN4"/>
    </xsl:element>
   </xsl:when>
   <xsl:when test="$Val=$REMAP_COLUMN_NAMEO5">
    <xsl:element name="REMAP_COLUMN_NAME">
     <xsl:value-of select="$REMAP_COLUMN_NAMEN5"/>
    </xsl:element>
   </xsl:when>
   <xsl:when test="$Val=$REMAP_COLUMN_NAMEO6">
    <xsl:element name="REMAP_COLUMN_NAME">
     <xsl:value-of select="$REMAP_COLUMN_NAMEN6"/>
    </xsl:element>
   </xsl:when>
   <xsl:when test="$Val=$REMAP_COLUMN_NAMEO7">
    <xsl:element name="REMAP_COLUMN_NAME">
     <xsl:value-of select="$REMAP_COLUMN_NAMEN7"/>
    </xsl:element>
   </xsl:when>
   <xsl:when test="$Val=$REMAP_COLUMN_NAMEO8">
    <xsl:element name="REMAP_COLUMN_NAME">
     <xsl:value-of select="$REMAP_COLUMN_NAMEN8"/>
    </xsl:element>
   </xsl:when>
   <xsl:when test="$Val=$REMAP_COLUMN_NAMEO9">
    <xsl:element name="REMAP_COLUMN_NAME">
     <xsl:value-of select="$REMAP_COLUMN_NAMEN9"/>
    </xsl:element>
   </xsl:when>
   <xsl:when test="$Val=$REMAP_COLUMN_NAMEO10">
    <xsl:element name="REMAP_COLUMN_NAME">
     <xsl:value-of select="$REMAP_COLUMN_NAMEN10"/>
    </xsl:element>
   </xsl:when>
  </xsl:choose>
  <xsl:copy>
   <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
 </xsl:template>
 <xsl:template match="STORAGE/TRANSPORTABLE">
  <!-- *******************************************************************
       Template: STORAGE/TRANSPORTABLE
 This is used to override the value of TRANSPORTABLE for views as tables.
******************************************************************** -->
  <xsl:choose>
   <xsl:when test="string-length($IN_TSNUM)!=0">
    <xsl:element name="TRANSPORTABLE">
     <xsl:value-of select="$IN_TSNUM"/>
    </xsl:element>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="INDEX_T/SPARE4">
  <!-- *******************************************************************
       Template: INDEX_T/SPARE4
 This is used to override the value of SPARE4 in non-partitioned indexes.
******************************************************************** -->
  <xsl:choose>
   <xsl:when test="string-length($IND_SPARE4)!=0">
    <SPARE4>
     <xsl:call-template name="SubstQuot">
      <xsl:with-param name="String" select="$IND_SPARE4"/>
     </xsl:call-template>
    </SPARE4>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="INDEX_T/PART_OBJ/PARTOBJ/DEFPARAMETERS">
  <!-- *******************************************************************
       Template: INDEX_T/PART_OBJ/PARTOBJ/DEFPARAMETERS
 This is used to override the value of function parameter in indexes.
 partitiond index parameters are fetched from INDEX_T/PART_OBJ/PARTOBJ/DEFPARAMETERS
 Note: For non-partitioned indexes these parameters are fetched from INDEX_T/SPARE4
          which is handle in the above template
******************************************************************** -->
  <xsl:choose>
   <xsl:when test="string-length($IND_SPARE4)!=0">
    <DEFPARAMETERS>
     <xsl:call-template name="SubstQuot">
      <xsl:with-param name="String" select="$IND_SPARE4"/>
     </xsl:call-template>
    </DEFPARAMETERS>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="COL_LIST_ITEM/DEFAULT_VAL | COL_LIST_ITEM/DEFAULT_VALC">
  <!-- *******************************************************************
       Template: COL_LIST_ITEM/DEFAULT_VAL(C)
 If version is pre-V12 and default value has sequence
 then make default value "NULL" (default expression with sequence
 cannot be understood by pre_12.0 RDBMS).
******************************************************************** -->
  <xsl:choose>
   <xsl:when test="$VERSION &lt; 1200000000 and (../PROPERTY2 mod 16)>=8">
    <DEFAULT_VAL>NULL</DEFAULT_VAL>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="COL_LIST_ITEM/CON">
  <!-- *******************************************************************
       Template: COL_LIST_ITEM/CON
  If version is pre-V12 and not-null constraint has a sequence
  then suppress the constraint (make the expression DEFAULT NULL).
******************************************************************** -->
  <xsl:choose>
   <xsl:when test="$VERSION &lt; 1200000000 and (../PROPERTY2 mod 16)>=8"/>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
</xsl:stylesheet>

OHA YOOOO