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/kutsnspace.xsl

<?xml version="1.0"?>
<!-- 
 Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
NAME
    kutsnspace.xsl
DESCRIPTION
    XSLT stylesheet for XML => DDL conversion of ku$_xsnspace_t ADTs
    (i.e., Triton Security Namespace objects):
    BEGIN
    xs_ns_template.create_ns_template(
     ns_name=>'XSNT3',
     ns_desc=>'namespace template 3',
     attributes=>xs$ns_attribute_list(
        xs$ns_attribute(
           name=>'nt3attr1',
           default_value=>'nt3attr1DefVal',
           attribute_events=>XS_NS_TEMPLATE.NO_EVENT),
        xs$ns_attribute(
           name=>'nt3attr2',
           attribute_events=>XS_NS_TEMPLATE.FIRSTREAD_EVENT),
        xs$ns_attribute(
           name=>'nt3attr3',
           default_value=>'nt3attr3DefVal',
           attribute_events=>XS_NS_TEMPLATE.UPDATE_EVENT)),
     handler_schema=>'TWSDBUSER',
     handler_package=>'TWSNTPKG',
     handler_function=>'TWSNTHDLR');
    END;


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
    bwright     08/21/13 - Bug 17312600: Remove hard tabs from DP src code
    rapayne     08/31/11 - Triton rename to Real Application Security (RAS).
                           Object names will be changed from TS_* to XS_*.
    rapayne     10/20/10 - Creation 
 -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <!-- Import required scripts -->
 <xsl:import href="kucommon.xsl"/>
 <!-- Top-level parameters -->
 <xsl:param name="PRETTY">1</xsl:param>
 <xsl:param name="SQLTERMINATOR">1</xsl:param>
 <!-- params for parse -->
 <xsl:param name="PRS_DDL">0</xsl:param>
 <xsl:param name="PRS_DELIM">\{]`</xsl:param>
 <xsl:param name="PRS_VERB">0</xsl:param>
 <xsl:param name="PRS_OBJECT_TYPE">0</xsl:param>
 <xsl:param name="PRS_SCHEMA">0</xsl:param>
 <xsl:param name="PRS_NAME">0</xsl:param>
 <xsl:param name="PRS_GRANTEE">0</xsl:param>
 <xsl:param name="PRS_GRANTOR">0</xsl:param>
 <xsl:param name="PRS_BASE_OBJECT_SCHEMA">0</xsl:param>
 <xsl:param name="PRS_BASE_OBJECT_NAME">0</xsl:param>
 <xsl:param name="PRS_BASE_OBJECT_TYPE">0</xsl:param>
 <xsl:template match="XS_NAMESPACE_T">
  <xsl:call-template name="DoParse">
   <xsl:with-param name="Verb">CREATE</xsl:with-param>
   <xsl:with-param name="ObjectType">XS_NAMESPACE</xsl:with-param>
   <xsl:with-param name="NameNode" select="XS_OBJ/NAME"/>
  </xsl:call-template>
  <xsl:text>&#xa;</xsl:text>
  <xsl:text>BEGIN&#xa; </xsl:text>
  <xsl:text>xs_namespace.create_template(</xsl:text>
  <xsl:text>&#xa;     </xsl:text>
  <xsl:text>name=></xsl:text>
  <xsl:call-template name="SingleQuotedName">
   <xsl:with-param name="NameNode" select="XS_OBJ/NAME"/>
  </xsl:call-template>
  <!-- generate description arg if present -->
  <xsl:if test="DESCRIPTION">
   <xsl:text>,&#xa;     description=></xsl:text>
   <xsl:call-template name="SingleQuotedName">
    <xsl:with-param name="NameNode" select="DESCRIPTION"/>
   </xsl:call-template>
  </xsl:if>
  <!-- generate ATTRIBUTE arg if present -->
  <xsl:if test="ATTR_LIST/ATTR_LIST_ITEM">
   <xsl:text>,&#xa;     attr_list=></xsl:text>
   <xsl:text>xs$ns_attribute_list(</xsl:text>
   <xsl:for-each select="ATTR_LIST/ATTR_LIST_ITEM">
    <xsl:sort order="ascending" select="ATTR_NAME"/>
    <xsl:call-template name="addNSAttr">
     <xsl:with-param name="attrNode" select="."/>
     <xsl:with-param name="lastAttr" select="position()=last()"/>
    </xsl:call-template>
   </xsl:for-each>
  </xsl:if>
  <!-- generate handler_ schema arg if present -->
  <xsl:if test="HANDLER_SCHEMA">
   <xsl:text>,&#xa;     schema=></xsl:text>
   <xsl:call-template name="SingleQuotedName">
    <xsl:with-param name="NameNode" select="HANDLER_SCHEMA"/>
   </xsl:call-template>
  </xsl:if>
  <!-- generate handler_package arg if present -->
  <xsl:if test="HANDLER_PKG">
   <xsl:text>,&#xa;     package=></xsl:text>
   <xsl:call-template name="SingleQuotedName">
    <xsl:with-param name="NameNode" select="HANDLER_PKG"/>
   </xsl:call-template>
  </xsl:if>
  <!-- generate handler_function arg if present -->
  <xsl:if test="HANDLER_FUNC">
   <xsl:text>,&#xa;     function=></xsl:text>
   <xsl:call-template name="SingleQuotedName">
    <xsl:with-param name="NameNode" select="HANDLER_FUNC"/>
   </xsl:call-template>
  </xsl:if>
  <!-- generate public_access arg if present -->
  <xsl:if test="PUBLIC_ACCESS">
   <xsl:text>,&#xa;     description=></xsl:text>
   <xsl:call-template name="SingleQuotedName">
    <xsl:with-param name="NameNode" select="HANDLER_FUNCTION"/>
   </xsl:call-template>
  </xsl:if>
  <xsl:text>);</xsl:text>
  <xsl:text>&#xa; </xsl:text>
  <xsl:text>END;</xsl:text>
  <xsl:if test="$SQLTERMINATOR=1">
   <xsl:text>&#xa;</xsl:text>
   <xsl:text>/</xsl:text>
  </xsl:if>
 </xsl:template>
 <xsl:template name="addNSAttr">
  <xsl:param name="attrNode" select="''"/>
  <xsl:param name="lastAttr" select="''"/>
  <!-- *******************************************************************
Template: addNSAttr
Parameters:
    attrNode  <ATTR_LIST_ITEM>
    lastAttr    - flag to denote the final attribute
******************************************************************** -->
  <xsl:text>&#xa;        </xsl:text>
  <xsl:text>xs$ns_attribute(</xsl:text>
  <xsl:text>&#xa;           </xsl:text>
  <xsl:text>name=></xsl:text>
  <xsl:call-template name="SingleQuotedName">
   <xsl:with-param name="NameNode" select="$attrNode/ATTR_NAME"/>
  </xsl:call-template>
  <!-- generate DEFAULT_VALUE arg if present (i.e., NULL = default) -->
  <xsl:if test="$attrNode/DEF_VALUE">
   <xsl:text>,&#xa;           </xsl:text>
   <xsl:text>default_value=></xsl:text>
   <xsl:call-template name="SingleQuotedName">
    <xsl:with-param name="NameNode" select="$attrNode/DEF_VALUE"/>
   </xsl:call-template>
  </xsl:if>
  <!-- generate ATTRIBUTE_EVENTS  arg if present (i.e., 0 = default) -->
  <xsl:if test="$attrNode/EVENT_CBK">
   <xsl:text>,&#xa;           </xsl:text>
   <xsl:text>attribute_events=></xsl:text>
   <xsl:choose>
    <xsl:when test="$attrNode/EVENT_CBK='0'">
     <xsl:text>XS_NAMESPACE.NO_EVENT</xsl:text>
    </xsl:when>
    <xsl:when test="$attrNode/EVENT_CBK='1'">
     <xsl:text>XS_NAMESPACE.FIRSTREAD_EVENT</xsl:text>
    </xsl:when>
    <xsl:when test="$attrNode/EVENT_CBK='2'">
     <xsl:text>XS_NAMESPACE.UPDATE_EVENT</xsl:text>
    </xsl:when>
    <xsl:otherwise>
     <xsl:value-of select="$attrNode/EVENT_CBK"/>
    </xsl:otherwise>
   </xsl:choose>
  </xsl:if>
  <xsl:text>)</xsl:text>
  <!-- close the xs$ns_attribute_list if this is the last attribute-->
  <xsl:choose>
   <xsl:when test="$lastAttr">
    <xsl:text>)</xsl:text>
   </xsl:when>
   <xsl:otherwise>
    <xsl:text>,</xsl:text>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
</xsl:stylesheet>

OHA YOOOO