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 2005/07/28 02:34:48 UTC

cvs commit: xml-xalan/java/samples/extensions/sql/streamable cachedNodes.xsl streamNodes.xsl pivot.xsl

johng       2005/07/27 17:34:48

  Modified:    java/samples/extensions/sql/streamable cachedNodes.xsl
                        streamNodes.xsl pivot.xsl
  Log:
  
  PR:XalanJ-2172	
  Obtained from:
  Submitted by:	John Gentilin	
  Reviewed by:	Yas Talwar
  CVS: ----------------------------------------------------------------------
  CVS: Change Example file to utilize the Apache Derby DBMS
  
  Revision  Changes    Path
  1.5       +8 -7      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- cachedNodes.xsl	28 Feb 2003 00:25:11 -0000	1.4
  +++ cachedNodes.xsl	28 Jul 2005 00:34:47 -0000	1.5
  @@ -14,9 +14,9 @@
   
   
   
  -<xsl:param name="driver" select="'com.lutris.instantdb.jdbc.idbDriver'"/>
  +<xsl:param name="driver" select="'org.apache.derby.jdbc.EmbeddedDriver'"/>
   
  -<xsl:param name="datasource" select="'jdbc:idb:../../instantdb/sample.prp'"/>
  +<xsl:param name="datasource" select="'jdbc:derby:sampleDB'"/>
   
   <xsl:param name="query" select="'SELECT * FROM import1'"/>
   
  @@ -30,9 +30,9 @@
   
       <!-- Connect to the database with minimal error detection -->
   
  -		<xsl:if test="not(sql:connect($db, $driver, $datasource))" >
  +    <xsl:if test="not(sql:connect($db, $driver, $datasource))" >
   
  -    	<xsl:message>Error Connecting to the Database</xsl:message>
  +      <xsl:message>Error Connecting to the Database</xsl:message>
   
         <xsl:copy-of select="sql:getError($db)/ext-error" />
   
  @@ -54,7 +54,8 @@
   
           <TABLE border="1">
   
  -        	<xsl:value-of select="sql:disableStreamingMode($db)" />
  +          <xsl:value-of select="sql:setFeature($db, 'streaming', 'false')" />
  +
   
             <xsl:variable name="table" select='sql:query($db, $query)'/>
   
  @@ -82,7 +83,7 @@
   
             <TR>
   
  -             <xsl:for-each select="$table/row-set/metadata/column-header">
  +             <xsl:for-each select="$table/sql/metadata/column-header">
   
                  <TH><xsl:value-of select="@column-label"/></TH>
   
  @@ -90,7 +91,7 @@
   
             </TR>
   
  -          <xsl:apply-templates select="$table/sql/row-set/row"/>
  +          <xsl:apply-templates select="$table/sql/row-set"/>
   
           </TABLE>
   
  
  
  
  1.4       +56 -50    xml-xalan/java/samples/extensions/sql/streamable/streamNodes.xsl
  
  Index: streamNodes.xsl
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/samples/extensions/sql/streamable/streamNodes.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- streamNodes.xsl	25 Jan 2002 19:41:32 -0000	1.3
  +++ streamNodes.xsl	28 Jul 2005 00:34:47 -0000	1.4
  @@ -1,51 +1,57 @@
  -<?xml version="1.0"?>
  -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  -                version="1.0"
  -                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
  -                extension-element-prefixes="sql">
  -
  -<xsl:output method="html" indent="yes"/>
  -
  -<xsl:param name="driver" select="'com.lutris.instantdb.jdbc.idbDriver'"/>
  -<xsl:param name="datasource" select="'jdbc:idb:../../instantdb/sample.prp'"/>
  -<xsl:param name="query" select="'SELECT * FROM import1'"/>
  -
  -<xsl:template match="/">
  -    <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>
  -        <TABLE border="1">
  -        	<xsl:value-of select="sql:enableStreamingMode($db)" />
  -          <xsl:variable name="table" select='sql:query($db, $query)'/>
  -          <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>
  -      </BODY>
  -    </HTML>
  -    <xsl:value-of select="sql:close($db)"/>
  -</xsl:template>
  -
  -<xsl:template match="row">
  -  <TR><xsl:apply-templates select="col"/></TR>
  -</xsl:template>
  -
  -<xsl:template match="col">
  -  <TD><xsl:value-of select="text()"/></TD>
  -</xsl:template>
  -
  +<?xml version="1.0"?>
  +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  +                version="1.0"
  +                xmlns:sql="org.apache.xalan.lib.sql.XConnection"
  +                extension-element-prefixes="sql">
  +
  +<xsl:output method="html" indent="yes"/>
  +
  +<xsl:param name="driver" select="'org.apache.derby.jdbc.EmbeddedDriver'"/>
  +
  +<xsl:param name="datasource" select="'jdbc:derby:sampleDB'"/>
  +
  +<xsl:param name="query" select="'SELECT * FROM import1'"/>
  +
  +<xsl:template match="/">
  +    <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>
  +        <TABLE border="1">
  +          
  +          <xsl:value-of select="sql:setFeature($db, 'streaming', 'true')" />
  +
  +          <xsl:variable name="table" select='sql:query($db, $query)'/>
  +
  +          <TR>
  +             <xsl:for-each select="$table/sql/metadata/column-header">
  +               <TH><xsl:value-of select="@column-label"/></TH>
  +             </xsl:for-each>
  +          </TR>
  +          <xsl:apply-templates select="$table/sql/row-set"/>
  +        </TABLE>
  +      </BODY>
  +    </HTML>
  +    <xsl:value-of select="sql:close($db)"/>
  +
  +</xsl:template>
  +
  +<xsl:template match="row">
  +  <TR><xsl:apply-templates select="col"/></TR>
  +</xsl:template>
  +
  +<xsl:template match="col">
  +  <TD><xsl:value-of select="text()"/></TD>
  +</xsl:template>
  +
   </xsl:stylesheet>
  \ No newline at end of file
  
  
  
  1.5       +9 -9      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- pivot.xsl	28 Feb 2003 00:25:11 -0000	1.4
  +++ pivot.xsl	28 Jul 2005 00:34:47 -0000	1.5
  @@ -14,9 +14,9 @@
   
   
   
  -<xsl:param name="driver" select="'com.lutris.instantdb.jdbc.idbDriver'"/>
  +<xsl:param name="driver" select="'org.apache.derby.jdbc.EmbeddedDriver'"/>
   
  -<xsl:param name="datasource" select="'jdbc:idb:../../instantdb/sample.prp'"/>
  +<xsl:param name="datasource" select="'jdbc:derby:sampleDB'"/>
   
   <xsl:param name="query" select="'SELECT * FROM import1'"/>
   
  @@ -30,9 +30,9 @@
   
       <!-- Connect to the database with minimal error detection -->
   
  -		<xsl:if test="not(sql:connect($db, $driver, $datasource))" >
  +    <xsl:if test="not(sql:connect($db, $driver, $datasource))" >
   
  -    	<xsl:message>Error Connecting to the Database</xsl:message>
  +      <xsl:message>Error Connecting to the Database</xsl:message>
   
         <xsl:copy-of select="sql:getError($db)/ext-error" />
   
  @@ -56,7 +56,7 @@
   
         <!-- Turn off Streaming -->
   
  -      <xsl:value-of select="sql:disableStreamingMode()" />
  +      <xsl:value-of select="sql:setFeature($db, 'streaming', 'false')" />
   
         
   
  @@ -66,7 +66,7 @@
   
         <!-- 
   
  -        	Let's include Error Checking, the error is actually stored 
  +         Let's include Error Checking, the error is actually stored 
   
             in the connection since $table will be either data or null
   
  @@ -100,7 +100,7 @@
   
             </TR>
   
  -          <xsl:apply-templates select="$table/sql/row-set/row"/>
  +          <xsl:apply-templates select="$table/sql/row-set"/>
   
           </TABLE>
   
  @@ -110,7 +110,7 @@
   
   
   
  -        <xsl:for-each select="$table/row-set/column-header">
  +        <xsl:for-each select="$table/sql/metadata/column-header">
   
           <xsl:variable name="column" select="@column-label" />
   
  @@ -122,7 +122,7 @@
   
               	<xsl:apply-templates
   
  -               	select="$table/row-set/row/col[@column-label=$column]" />
  +               	select="$table/sql/row-set/row/col[@column-label=$column]" />
   
             </TR>
   
  
  
  

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