<. Hi users! .>
I have strange problem with ESQL. I want read xml from database as full xml document (not fragment). So I decided to use <esql:get-xml>, it works almost fine. 'Almost' because I must insert the xml from database in some tag, the root element of xml in database can't be root element in returned document. :-(
My XSP and log are included below.
This XSP works good: <?xml version="1.0" encoding="UTF-8"?> <xsp:page language="java" xmlns:xsp="http://apache.org/xsp" xmlns:esql="http://apache.org/cocoon/SQL/v2"> <text> <esql:connection> <esql:pool>warsztat</esql:pool> <esql:execute-query> <esql:query>SELECT * FROM artykuly</esql:query> <esql:results> <esql:row-results> <esql:get-xml column="text"/> </esql:row-results> </esql:results> </esql:execute-query> </esql:connection> </text> </xsp:page>
This XSP: <?xml version="1.0" encoding="UTF-8"?> <xsp:page language="java" xmlns:xsp="http://apache.org/xsp" xmlns:esql="http://apache.org/cocoon/SQL/v2"> <esql:connection> <esql:pool>warsztat</esql:pool> <esql:execute-query> <esql:query>SELECT * FROM artykuly</esql:query> <esql:results> <esql:row-results> <esql:get-xml column="text"/> </esql:row-results> </esql:results> </esql:execute-query> </esql:connection> </xsp:page>
raise exception:
DEBUG (2003-09-06) 19:53.25:402 [core.program-generator] (/cocoon/cvs-local/warsztat/plain/artykuly/get-article.xml) Thread-11/ProgramGeneratorImpl: Got Language Exception
org.apache.cocoon.components.language.LanguageException: Error compiling get_article_template_xml:
ERROR 1 (org\apache\cocoon\www\cvs_local\warsztat\artykuly\get_article_template_xml.java):
I'm afraid you'll have to use a XSLT transform to strip the root element because XSP puts everything before the first non-xsp-tag outside the generate method.... together with esql is the result that some esql tags are ignored (not replaced with their corresponding java code) and java statements appearing in illegal places from a java POV.
Chris.
-- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]