SuperX-Kernmodul
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

79 lines
2.2 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="create_function">
<xsl:param name="dbsystem"/>
<xsl:text>--Funktion / Prozedur </xsl:text><xsl:value-of select="name" /><xsl:text>
</xsl:text>
<!--<xsl:call-template name="log">
<xsl:with-param name="msg" select="concat('Erzeuge Funktion ',name)" />
</xsl:call-template>-->
<xsl:for-each select="src">
<xsl:choose>
<xsl:when test="file != '' ">
<xsl:choose>
<xsl:when test="$dbsystem='POSTGRES' and dbsystem='POSTGRES'">
<xsl:text>\! DOSQL </xsl:text><xsl:value-of select="file" /><xsl:text>
</xsl:text>
</xsl:when>
<xsl:when test="$dbsystem='INFORMIX' and dbsystem='INFORMIX'">
<xsl:text>! DOSQL </xsl:text><xsl:value-of select="file" /><xsl:text>
</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$dbsystem='POSTGRES' and dbsystem='POSTGRES'">
<xsl:value-of select="body" />
</xsl:when>
<xsl:when test="$dbsystem='INFORMIX' and dbsystem='INFORMIX'">
<xsl:value-of select="body" />
</xsl:when>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<xsl:template name="drop_function">
<xsl:param name="dbsystem"/>
<xsl:for-each select="src">
<xsl:choose>
<xsl:when test="$dbsystem='POSTGRES' and dbsystem='POSTGRES'">
<xsl:text>drop </xsl:text>
<xsl:value-of select="type" />
<xsl:text> </xsl:text>
<xsl:value-of select="../name" />
<xsl:text>(</xsl:text>
<xsl:for-each select="../parameters/param">
<xsl:value-of select="type" />
<xsl:if test="position() &lt; last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>);
</xsl:text>
</xsl:when>
<xsl:when test="$dbsystem='INFORMIX' and dbsystem='INFORMIX'">
<xsl:text>drop </xsl:text>
<xsl:value-of select="type" /><xsl:text> </xsl:text><xsl:value-of select="../name" /><xsl:text>(</xsl:text>
<xsl:for-each select="../parameters/param">
<xsl:value-of select="type" />
<xsl:if test="position() &lt; last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each><xsl:text>);
</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>