You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andrzej Artur Pol <A....@elka.pw.edu.pl> on 2001/01/14 00:51:02 UTC

How to get XML data from DB ?

Hi, its possible to get XML formed data stored in DB (mySQL) ?
I've tried to use <esql:get-xml> from esql taglib but with no results
there. What is wrong ? How to do it ????

I attempted to run such example:
(esql.xml)

<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?xml-logicsheet
href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>

<xsp:page
  language="java"
  xmlns:esql="http://apache.org/cocoon/SQL/v2"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>

<page>

<esql:execute-query>
	<esql:driver>org.gjt.mm.mysql.Driver</esql:driver>
	<esql:dburl>jdbc:mysql://localhost/test</esql:dburl>
	<esql:query>select title from article</esql:query>
	<esql:results>
		<id><esql:get-xml column="title"/></id>
  	</esql:results>
</esql:execute-query>

</page>

</xsp:page>

result:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<page>

<id></id>

</page>

Why <id> tag is empty ?
Regards, Andrzej


Re: How to get XML data from DB ?

Posted by Donald Ball <ba...@webslingerZ.com>.
On Sun, 14 Jan 2001, Klaus Drechsler wrote:

> At 01:13 14.01.2001, you wrote:
> >you're using an old version of the esql logicsheet and an old version of
> >the esql schema. get the latest version from cvs and give it a whirl.
>
> How do I get the latest ESQL Version from cvs?

http://xml.apache.org/cvs.html

you can get stuff piecemeal from web-cvs, but i highly recommend you just
grab a copy of the entire repository via cvs and build a new cocoon.jar
from it - it's very easy.

- donald


Re: How to get XML data from DB ?

Posted by Klaus Drechsler <dr...@gmx.net>.
At 01:13 14.01.2001, you wrote:
>you're using an old version of the esql logicsheet and an old version of
>the esql schema. get the latest version from cvs and give it a whirl.


How do I get the latest ESQL Version from cvs?

ciao,
  Klaus

--------------------------------------
Farewell! I will omit no opportunity
That may convey my greetings, love, to thee.
Romeo&Juliet
                         (Act III, Scene V)
--------------------------------------
PGP-Key: http://www.kdnet.de/pgp


Re: How to get XML data from DB ?

Posted by Donald Ball <ba...@webslingerZ.com>.
On Sun, 14 Jan 2001, Andrzej Artur Pol wrote:

> I attempted to run such example:
> (esql.xml)
>
> <?xml version="1.0"?>
> <?cocoon-process type="xsp"?>
> <?xml-logicsheet
> href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>
>
> <xsp:page
>   language="java"
>   xmlns:esql="http://apache.org/cocoon/SQL/v2"
>   xmlns:xsp="http://www.apache.org/1999/XSP/Core"
> >
>
> <page>
>
> <esql:execute-query>
> 	<esql:driver>org.gjt.mm.mysql.Driver</esql:driver>
> 	<esql:dburl>jdbc:mysql://localhost/test</esql:dburl>
> 	<esql:query>select title from article</esql:query>
> 	<esql:results>
> 		<id><esql:get-xml column="title"/></id>
>   	</esql:results>
> </esql:execute-query>
>
> </page>
>
> </xsp:page>

you're using an old version of the esql logicsheet and an old version of
the esql schema. get the latest version from cvs and give it a whirl.

- donald