You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Jaiswal, Vinay (CTS)" <JV...@chn.cognizant.com> on 2001/02/20 17:58:46 UTC

Data extraction from MySql Database by xml page

Hi folks,

I need to extract data from MySql database by xml document..and in turn
it is to be converted into HTML page.

This is the xml file:

<?xml version="1.0"?>
<?xml-stylesheet href="html.xsl" type="text/xsl"?>
<?xml-stylesheet href="wml.xsl" type="text/xsl" media="wap"?>
<?cocoon-process type="sql"?>
<?cocoon-process type="xslt"?>

<page>
<connectiondefs>
 <connection name="test">
  <driver>org.gjt.mm.mysql.Driver</driver>
  <dburl>jdbc:mysql://localhost/test</dburl>
  <!--<username>jv3887</username>
  <password>jv3887</password>-->
 </connection>
</connectiondefs>

<query connection="test">
select * from members
</query>
</page>

And this is the html.xsl file..

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              xmlns="http://apache.org/cocoon/SQL/v2">

<xsl:template match="/">
<xsl:processing-instruction
name="cocoon-format">type="text/html"</xsl:processing-instruction>
  
  
  <html>
  <head>
  <title><![CDATA[R & D first page]]></title>
  </head>  
  <body BGCOLOR="#BBBBBB" background="backgrd.gif" text="blue">
  
  
  <xsl:apply-templates/> 
  
 
</body> 
  </html>
  
</xsl:template>
 

<xsl:template match="bla..bla">
<p><b><h2><I><xsl:apply-templates/></I></h2></b></p>
</xsl:template>
</xsl:stylesheet>

But I'm not getting data from MySql database..

It is printing..

org.gjt.mm.mysql.Driver jdbc:mysql://10.236.177.73/test select * from
members

Any help will be highly appreciated..
Vinay Jaiswal    


This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

		Visit us at http://www.cognizant.com