You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Hiloliddin Karimov <HK...@central.nbu.com> on 2002/05/20 16:17:05 UTC
SQL Generators and SQL Transformers
Hi All,
I try retrieve data from DB (load some data from DB) before page show.
How I understood, I can it by Generators and Transformers. If there is more,
please tell me know ( if possible pls in detail ).
1. I try use the SQL Transformer, retrieve rows from DB and to show their in
XML. It like works, but I have small problem.
I get only column names, there no value?
like it...
<sql:row>
<sql:username />
<sql:balance />
<sql:status />
</sql:row>
<sql:row>
<sql:username />
<sql:balance />
<sql:status />
</sql:row>
</sql:rowset>
...
Here what I have:
sitemap.xmap
====
...
<map:match pattern="show.html">
<map:generate src="templates/sql/show.xml"/>
<map:transform src="stylesheets/myapp.xsl"/>
<map:transform type="sql">
<map:parameter name="use-connection" value="personnel"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
show.xml
====
...
<query>
SELECT username, balance, status FROM users
</query>
...
???
2. And I found like it in archive:
<map:generate type="sql" src="select * from emp"/>
But I couldn't that it works, in detail I didn't found. How can I use it?
Thanks a lot,
Hill
Cocoon 2.1 (xml-cocoon2_20020517041743.tar.gz); Tomcat 4.0; JDK SDK 1.3.1;
Oracle 7; WinNT 4.0;
PS: If it would be in forum.java.sun.com, I have put more than 10 Duke
Dollars :))
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>