Changes for page Engine_XalanJ

Last modified by Nicolas Gregoire on 2012/01/31 17:35

From version Icon 62.1 Icon
edited by Nicolas Gregoire
on 2012/01/12 22:13
Change comment: Upload new attachment xalanj-jdbc-query.xsl
To version Icon 61.1 Icon
edited by Nicolas Gregoire
on 2012/01/12 22:11
Change comment: There is no comment for this version

Summary

Details

Icon xalanj-jdbc-query.xsl
Author
... ... @@ -1,1 +1,0 @@
1 -xwiki:XWiki.NicolasGregoire
Size
... ... @@ -1,1 +1,0 @@
1 -848 bytes
Content
... ... @@ -1,22 +1,0 @@
1 -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2 - xmlns:sql="org.apache.xalan.lib.sql.XConnection"
3 - extension-element-prefixes="sql"
4 - version="1.0">
5 -
6 -<xsl:output method="xml" indent="yes"/>
7 -
8 -<xsl:param name="driver" select="'com.mysql.jdbc.Driver'"/>
9 -<xsl:param name="dburl" select="'jdbc:mysql://localhost/test_db'"/>
10 -<xsl:param name="user" select="'root'"/>
11 -<xsl:param name="pass" select="'14m31337'"/>
12 -<xsl:param name="query" select="'SELECT uid,username,passwd FROM users'"/>
13 -
14 -<xsl:template match="/">
15 - <xsl:variable name="dbh" select="sql:new($driver, $dburl, $user, $pass)"/>
16 - <xsl:variable name="table" select='sql:query($dbh, $query)'/>
17 - <xsl:copy-of select="$table" />
18 - <xsl:value-of select="sql:close($db)"/>
19 -</xsl:template>
20 -
21 -</xsl:stylesheet>
22 -