[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
r5089 - trunk/gnue-common/utils/xml2sql
From: |
johannes |
Subject: |
r5089 - trunk/gnue-common/utils/xml2sql |
Date: |
Tue, 10 Feb 2004 03:17:43 -0600 (CST) |
Author: johannes
Date: 2004-02-10 03:17:38 -0600 (Tue, 10 Feb 2004)
New Revision: 5089
Modified:
trunk/gnue-common/utils/xml2sql/pgsql.xsl
trunk/gnue-common/utils/xml2sql/pgsql_2.xsl
Log:
Columnlists of insert-statements will be created only, if the field-attribute
is given in value-rows.
Modified: trunk/gnue-common/utils/xml2sql/pgsql.xsl
===================================================================
--- trunk/gnue-common/utils/xml2sql/pgsql.xsl 2004-02-09 22:45:34 UTC (rev
5088)
+++ trunk/gnue-common/utils/xml2sql/pgsql.xsl 2004-02-10 09:17:38 UTC (rev
5089)
@@ -1,5 +1,5 @@
+<?xml version="1.0"?>
<!-- $Id$ -->
-<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/schema"><sql>
<xsl:for-each select="tables/table">
@@ -139,17 +139,22 @@
<xsl:for-each select="rows/row">
<command><xsl:text>Insert into </xsl:text>
<xsl:value-of select="$tableName"/>
- <xsl:text> (</xsl:text>
+ <xsl:variable name="numFDefs" select="count(value/@field)"/>
<xsl:variable name="numValues" select="count(value)"/>
- <!-- list of columns -->
- <xsl:for-each select="value">
- <xsl:value-of select="@field"/>
- <xsl:if test="position() < $numValues">
- <xsl:text>, </xsl:text>
- </xsl:if>
- </xsl:for-each>
+
+ <xsl:if test="$numFDefs > 0">
+ <!-- list of columns -->
+ <xsl:text> (</xsl:text>
+ <xsl:for-each select="value">
+ <xsl:value-of select="@field"/>
+ <xsl:if test="position() < $numValues">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
<!-- -->
- <xsl:text>) values (</xsl:text>
+ <xsl:text> values (</xsl:text>
<!-- values -->
<xsl:for-each select="value">
<xsl:value-of select="."/>
Modified: trunk/gnue-common/utils/xml2sql/pgsql_2.xsl
===================================================================
--- trunk/gnue-common/utils/xml2sql/pgsql_2.xsl 2004-02-09 22:45:34 UTC (rev
5088)
+++ trunk/gnue-common/utils/xml2sql/pgsql_2.xsl 2004-02-10 09:17:38 UTC (rev
5089)
@@ -1,5 +1,5 @@
+<?xml version="1.0"?>
<!-- $Id$ -->
-<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/schema"><sql>
<xsl:for-each select="tables/table">
@@ -112,17 +112,22 @@
<xsl:for-each select="rows/row">
<command><xsl:text>Insert into </xsl:text>
<xsl:value-of select="$tableName"/>
- <xsl:text> (</xsl:text>
+ <xsl:variable name="numFDefs" select="count(value/@field)"/>
<xsl:variable name="numValues" select="count(value)"/>
- <!-- list of columns -->
- <xsl:for-each select="value">
- <xsl:value-of select="@field"/>
- <xsl:if test="position() < $numValues">
- <xsl:text>, </xsl:text>
- </xsl:if>
- </xsl:for-each>
+
+ <xsl:if test="$numFDefs > 0">
+ <!-- list of columns -->
+ <xsl:text> (</xsl:text>
+ <xsl:for-each select="value">
+ <xsl:value-of select="@field"/>
+ <xsl:if test="position() < $numValues">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
<!-- -->
- <xsl:text>) values (</xsl:text>
+ <xsl:text> values (</xsl:text>
<!-- values -->
<xsl:for-each select="value">
<xsl:value-of select="."/>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- r5089 - trunk/gnue-common/utils/xml2sql,
johannes <=