<?xml version="1.0"?>
<!-- 
 Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. 
NAME
    kumodts.xsl
DESCRIPTION
    XSLT stylesheet for MODIFY of objects with tablespaces
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
    sdavidso    01/18/11 - fix typo in wildcard remap - defts
    lbarton     01/10/11 - remap any tbs name to x
    tbhukya     09/20/09 - Bug 8815633: REMAP_TABLESPACE for tablespace name
                         - in interval partition store-in clause
    lbarton     11/02/05 - Bug 4715313: reformat files for use with XMLSpy 
    lbarton     10/16/02 - REMAP_TABLESPACE for user default/temp ts
    lbarton     07/10/02 - lbarton_mdapi_modify_transform
    lbarton     06/14/02 - Created
 -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 <xsl:template match="TS_NAME">
  <xsl:choose>
   <xsl:when test="$REMAP_TABLESPACEO1='%'">
    <TS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN1"/>
    </TS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO1">
    <TS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN1"/>
    </TS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO2">
    <TS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN2"/>
    </TS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO3">
    <TS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN3"/>
    </TS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO4">
    <TS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN4"/>
    </TS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO5">
    <TS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN5"/>
    </TS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO6">
    <TS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN6"/>
    </TS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO7">
    <TS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN7"/>
    </TS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO8">
    <TS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN8"/>
    </TS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO9">
    <TS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN9"/>
    </TS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO10">
    <TS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN10"/>
    </TS_NAME>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="DEFTS_NAME">
  <xsl:choose>
   <xsl:when test=".=$REMAP_TABLESPACEO1 or '%'=$REMAP_TABLESPACEO1">
    <DEFTS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN1"/>
    </DEFTS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO2">
    <DEFTS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN2"/>
    </DEFTS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO3">
    <DEFTS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN3"/>
    </DEFTS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO4">
    <DEFTS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN4"/>
    </DEFTS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO5">
    <DEFTS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN5"/>
    </DEFTS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO6">
    <DEFTS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN6"/>
    </DEFTS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO7">
    <DEFTS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN7"/>
    </DEFTS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO8">
    <DEFTS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN8"/>
    </DEFTS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO9">
    <DEFTS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN9"/>
    </DEFTS_NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO10">
    <DEFTS_NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN10"/>
    </DEFTS_NAME>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="DATATS">
  <xsl:choose>
   <xsl:when test=".=$REMAP_TABLESPACEO1">
    <DATATS>
     <xsl:value-of select="$REMAP_TABLESPACEN1"/>
    </DATATS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO2">
    <DATATS>
     <xsl:value-of select="$REMAP_TABLESPACEN2"/>
    </DATATS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO3">
    <DATATS>
     <xsl:value-of select="$REMAP_TABLESPACEN3"/>
    </DATATS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO4">
    <DATATS>
     <xsl:value-of select="$REMAP_TABLESPACEN4"/>
    </DATATS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO5">
    <DATATS>
     <xsl:value-of select="$REMAP_TABLESPACEN5"/>
    </DATATS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO6">
    <DATATS>
     <xsl:value-of select="$REMAP_TABLESPACEN6"/>
    </DATATS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO7">
    <DATATS>
     <xsl:value-of select="$REMAP_TABLESPACEN7"/>
    </DATATS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO8">
    <DATATS>
     <xsl:value-of select="$REMAP_TABLESPACEN8"/>
    </DATATS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO9">
    <DATATS>
     <xsl:value-of select="$REMAP_TABLESPACEN9"/>
    </DATATS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO10">
    <DATATS>
     <xsl:value-of select="$REMAP_TABLESPACEN10"/>
    </DATATS>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="TEMPTS">
  <xsl:choose>
   <xsl:when test=".=$REMAP_TABLESPACEO1">
    <TEMPTS>
     <xsl:value-of select="$REMAP_TABLESPACEN1"/>
    </TEMPTS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO2">
    <TEMPTS>
     <xsl:value-of select="$REMAP_TABLESPACEN2"/>
    </TEMPTS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO3">
    <TEMPTS>
     <xsl:value-of select="$REMAP_TABLESPACEN3"/>
    </TEMPTS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO4">
    <TEMPTS>
     <xsl:value-of select="$REMAP_TABLESPACEN4"/>
    </TEMPTS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO5">
    <TEMPTS>
     <xsl:value-of select="$REMAP_TABLESPACEN5"/>
    </TEMPTS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO6">
    <TEMPTS>
     <xsl:value-of select="$REMAP_TABLESPACEN6"/>
    </TEMPTS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO7">
    <TEMPTS>
     <xsl:value-of select="$REMAP_TABLESPACEN7"/>
    </TEMPTS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO8">
    <TEMPTS>
     <xsl:value-of select="$REMAP_TABLESPACEN8"/>
    </TEMPTS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO9">
    <TEMPTS>
     <xsl:value-of select="$REMAP_TABLESPACEN9"/>
    </TEMPTS>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO10">
    <TEMPTS>
     <xsl:value-of select="$REMAP_TABLESPACEN10"/>
    </TEMPTS>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="PARTOBJ/INSERT_TS_LIST/INSERT_TS_LIST_ITEM/NAME">
  <xsl:choose>
   <xsl:when test=".=$REMAP_TABLESPACEO1">
    <NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN1"/>
    </NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO2">
    <NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN2"/>
    </NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO3">
    <NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN3"/>
    </NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO4">
    <NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN4"/>
    </NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO5">
    <NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN5"/>
    </NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO6">
    <NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN6"/>
    </NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO7">
    <NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN7"/>
    </NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO8">
    <NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN8"/>
    </NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO9">
    <NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN9"/>
    </NAME>
   </xsl:when>
   <xsl:when test=".=$REMAP_TABLESPACEO10">
    <NAME>
     <xsl:value-of select="$REMAP_TABLESPACEN10"/>
    </NAME>
   </xsl:when>
   <xsl:otherwise>
    <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
</xsl:stylesheet>
