Xalan XSLT and SQL
"Loren M. Lang" <[email protected]> Wed, 08 Dec 2010 16:02:07 -0800
| Newsgroups | gmane.text.xml.xalan.java.user |
|---|---|
| Message-ID | <[email protected]> |
I'm trying to use the SQL extension for Xalan to generate an XML
document from a MySQL database. I have the MySQL J/Connector in my
class path, but I get an error with sql:new() trying to load the driver:
$ java -classpath
mysql-connector-java-5.1.13/mysql-connector-java-5.1.13-bin.jar -jar
xalan-j_2_7_1/xalan.jar -xsl xalan-sql.xsl
xalan-sql.xsl; Line #8; Column #129; java.lang.IllegalArgumentException:
Invalid Driver Name Specified!
According to MySQL's documentation, the driver name is
com.mysql.jdbc.Driver. Here is the XSL file I am testing with:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:sql="http://xml.apache.org/xalan/sql"
extension-element-prefixes="sql">
<xsl:output method="html"/>
<xsl:template match="/">
<xsl:variable name="products"
select="sql:new('com.mysql.jdbc.Driver', 'jdbc:mysql://localhost/test',
'user', 'password')"/>
</xsl:template>
</xsl:stylesheet>
Any ideas? I have used J/Connector before with other Java programs.
--
Loren M. Lang
[email protected]
http://www.north-winds.org/
Public Key: ftp://ftp.north-winds.org/pub/lorenl_pubkey.asc
Fingerprint: 10A0 7AE2 DAF5 4780 888A 3FA4 DCEE BB39 7654 DE5B
signature.asc
(application/pgp-signature, 292 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREIAAYFAk0AHIUACgkQK4E3wSYMB0tIrwEAufXE77/ZRe2LMqcOIBelreW+ /EJ8DgRvp6ZP8wBJ/PEA/2SmFJrSVZjaDo7qnxLRnD9q4k0TVbc8IoT1Q/HLf2+c =EeR0 -----END PGP SIGNATURE-----