haul 01/11/19 07:23:53 Modified: src/org/apache/cocoon/components/language/markup/xsp/java esql.xsl documentation/xdocs/userdocs/xsp esql.xml Log: - added missing error template - added get-struct & get-array tags for ORDBMS access Revision Changes Path 1.23 +21 -1 xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl Index: esql.xsl =================================================================== RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- esql.xsl 2001/10/17 14:12:14 1.22 +++ esql.xsl 2001/11/19 15:23:53 1.23 @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<!-- $Id: esql.xsl,v 1.22 2001/10/17 14:12:14 haul Exp $--> +<!-- $Id: esql.xsl,v 1.23 2001/11/19 15:23:53 haul Exp $--> <!-- ============================================================================ @@ -207,6 +207,7 @@ <xsp:include>java.sql.PreparedStatement</xsp:include> <xsp:include>java.sql.ResultSet</xsp:include> <xsp:include>java.sql.ResultSetMetaData</xsp:include> + <xsp:include>java.sql.Struct</xsp:include> <xsp:include>java.sql.SQLException</xsp:include> <xsp:include>java.sql.Clob</xsp:include> <xsp:include>java.text.SimpleDateFormat</xsp:include> @@ -793,6 +794,16 @@ <xsp:expr><xsl:call-template name="get-resultset"/>.getObject(<xsl:call-template name="get-column"/>)</xsp:expr> </xsl:template> +<xspdoc:desc>returns the value of the given column as an array</xspdoc:desc> +<xsl:template match="esql:row-results//esql:get-array"> + <xsp:expr><xsl:call-template name="get-resultset"/>.getArray(<xsl:call-template name="get-column"/>)</xsp:expr> +</xsl:template> + +<xspdoc:desc>returns the value of the given column as a struct</xspdoc:desc> +<xsl:template match="esql:row-results//esql:get-struct"> + <xsp:expr>(Struct) <xsl:call-template name="get-resultset"/>.getObject(<xsl:call-template name="get-column"/>)</xsp:expr> +</xsl:template> + <xspdoc:desc>returns the value of the given column as an integer</xspdoc:desc> <xsl:template match="esql:row-results//esql:get-int"> <xsp:expr><xsl:call-template name="get-resultset"/>.getInt(<xsl:call-template name="get-column"/>)</xsp:expr> @@ -1004,6 +1015,15 @@ : "" </xsl:otherwise> </xsl:choose> +</xsl:template> + +<!-- + Break on error. + @param message explanation of the error +--> +<xsl:template name="error"> + <xsl:param name="message"/> + <xsl:message terminate="yes"><xsl:value-of select="$message"/></xsl:message> </xsl:template> <xsl:template match="@*|node()" priority="-1"> 1.3 +7 -0 xml-cocoon2/documentation/xdocs/userdocs/xsp/esql.xml Index: esql.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/documentation/xdocs/userdocs/xsp/esql.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- esql.xml 2001/10/25 14:58:43 1.2 +++ esql.xml 2001/11/19 15:23:53 1.3 @@ -139,6 +139,13 @@ <tr><td>esql:row-results//esql:get-object</td> <td>returns the value of the given column as an object</td> </tr> + <tr><td>esql:row-results//esql:get-array</td> + <td>returns the value of the given column as an java.sql.Array. This is frequently used for collection + datatypes like lists, sets, bags etc.</td> + </tr> + <tr><td>esql:row-results//esql:get-struct</td> + <td>returns the value of the given column as a java.sql.Struct. This is frequently used for row types.</td> + </tr> <tr><td>esql:row-results//esql:get-xml</td> <td>returns the value of the given column interpreted as an xml fragment. The fragment is parsed by the default xsp parser and the document element is returned.
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]