You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by jo...@apache.org on 2001/08/01 20:32:34 UTC
cvs commit: xml-xalan/java/samples/extensions/sql/streamable pivot.xsl
johng 01/08/01 11:32:34
Modified: java/samples/extensions/sql/streamable pivot.xsl
Log:
dded new connect method and error checking
Submitted by: John Gentilin
Revision Changes Path
1.2 +24 -13 xml-xalan/java/samples/extensions/sql/streamable/pivot.xsl
Index: pivot.xsl
===================================================================
RCS file: /home/cvs/xml-xalan/java/samples/extensions/sql/streamable/pivot.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pivot.xsl 2001/04/19 18:54:18 1.1
+++ pivot.xsl 2001/08/01 18:32:34 1.2
@@ -11,15 +11,38 @@
<xsl:param name="query" select="'SELECT * FROM import1'"/>
<xsl:template match="/">
- <xsl:variable name="db" select="sql:new($driver, $datasource)"/>
+ <xsl:variable name="db" select="sql:new()"/>
+
+ <!-- Connect to the database with minimal error detection -->
+ <xsl:if test="not(sql:connect($db, $driver, $datasource))" >
+ <xsl:message>Error Connecting to the Database</xsl:message>
+ <xsl:copy-of select="sql:getError($db)/ext-error" />
+ </xsl:if>
+
<HTML>
<HEAD>
<TITLE>List of products</TITLE>
</HEAD>
<BODY>
+
+ <!-- Turn off Streaming -->
+ <xsl:value-of select="sql:disableStreamingMode()" />
+
<xsl:variable name="table" select='sql:query($db, $query)'/>
+ <!--
+ Let's include Error Checking, the error is actually stored
+ in the connection since $table will be either data or null
+ -->
+
+ <xsl:if test="not($table)" >
+ <xsl:message>Error in Query</xsl:message>
+ <xsl:copy-of select="sql:getError($db)/ext-error" />
+ </xsl:if>
+
+
+
<TABLE border="1">
<TR>
<xsl:for-each select="$table/row-set/column-header">
@@ -29,18 +52,6 @@
<xsl:apply-templates select="$table/row-set/row"/>
</TABLE>
-<!--
- <TABLE border="1">
- <TR>
- <xsl:for-each select="$table/row-set/column-header">
- <TH><xsl:value-of select="@column-label"/></TH>
- </xsl:for-each>
- </TR>
- <xsl:apply-templates select="$table/row-set/row"/>
- </TABLE>
-
- -->
-
<TABLE border="1">
<xsl:for-each select="$table/row-set/column-header">
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org