johng 01/08/05 22:05:22
Modified: java/samples/extensions/sql/streamable cachedNodes.xsl
Log:
Updated cahcedNodes.xsl to use new function calls
Submitted by: John Gentilin
Revision Changes Path
1.2 +20 -2
xml-xalan/java/samples/extensions/sql/streamable/cachedNodes.xsl
Index: cachedNodes.xsl
===================================================================
RCS file:
/home/cvs/xml-xalan/java/samples/extensions/sql/streamable/cachedNodes.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cachedNodes.xsl 2001/04/19 18:54:18 1.1
+++ cachedNodes.xsl 2001/08/06 05:05:22 1.2
@@ -11,7 +11,14 @@
<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>
@@ -19,8 +26,19 @@
</HEAD>
<BODY>
<TABLE border="1">
- <xsl:value-of select="sql:enableCacheNodes($db)" />
+ <xsl:value-of select="sql:disableStreamingMode($db)" />
<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>
+
<TR>
<xsl:for-each select="$table/row-set/column-header">
<TH><xsl:value-of select="@column-label"/></TH>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]