xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject cvs commit: xml-xalan/java/samples/extensions/sql/pquery dbtest.xsl
Date Wed, 01 Aug 2001 18:29:16 GMT
johng       01/08/01 11:29:16

  Modified:    java/samples/extensions/sql/pquery dbtest.xsl
  Log:
  dded new connect method and error checking
  Submitted by:	John Gentilin
  
  Revision  Changes    Path
  1.3       +22 -2     xml-xalan/java/samples/extensions/sql/pquery/dbtest.xsl
  
  Index: dbtest.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/samples/extensions/sql/pquery/dbtest.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- dbtest.xsl	2001/05/01 21:11:36	1.2
  +++ dbtest.xsl	2001/08/01 18:29:16	1.3
  @@ -17,7 +17,14 @@
   <xsl:param name="cinfo" select="//DBINFO" />
   
   <xsl:template match="/">
  -    <xsl:variable name="db" select="sql:new($cinfo)"/>
  +    <xsl:variable name="db" select="sql:new()"/>
  +    
  +    <!-- Connect to the database with minimal error detection -->
  +		<xsl:if test="not(sql:connect($db, $cinfo))" >
  +    	<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>
  @@ -26,7 +33,20 @@
           <TABLE border="1">
             <xsl:variable name="qparam" select="//QUERY"/>
             <xsl:value-of select="sql:addParameterFromElement($db, $qparam)"/>
  +
             <xsl:variable name="table" select='sql:pquery($db, $q1, $q1type )'/>
  +          
  +          <!-- 
  +          	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>
  @@ -47,4 +67,4 @@
     <TD><xsl:value-of select="text()"/></TD>
   </xsl:template>
   
  -</xsl:stylesheet>
  \ No newline at end of file
  +</xsl:stylesheet>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message