You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Antonio Gallardo <ag...@agsoftware.dnsalias.com> on 2002/11/21 01:45:32 UTC
Re: duplicate definition of variable when using esql in xsp and own l ogicsheet
Hi!
I think you can make use of esql transformation. I guess you are using
xsp:esql in you XSP file, because you need to get new data from the
database with the base of the first data you got from your own logicsheet.
I am correct?
If this is the problem, then is generated because Cocoon cannot know you
are trying to make use of xsp:esql in TWO steps.
I recommend you to read the chapter #6 from the Carsten-Matthew book. You
can read this chapter it at: http://xml.apache.org/cocoon/link/books.html
Better I recommend you buy the book. I hope it can help ;-)
Regards,
Antonio Gallardo
> Hi,
>
> I am trying to write my own logicsheet which uses esql to fetch some
> data from a mysql database. This works fine as long as the xsp-page
> itself does not use esql. However, when I also want to use esql in the
> xsp, I get a lot of 'duplicate definition of variable' errors. How can I
> resolve this?
>
> Thanks,
>
> Andreas
>
> Below are the logicsheet, the xsp file and the errors I get:
>
> Part of the mm_logic.xsl file:
>
> <?xml version="1.0"?>
> <xsl:stylesheet
> version="1.0"
> xmlns:xsp="http://apache.org/xsp"
> xmlns:session="http://apache.org/xsp/session/2.0"
> xmlns:mm="http://siemens.com/mm"
> xmlns:esql="http://apache.org/cocoon/SQL/v2"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> ...
> <!-- database access -->
>
> <esql:connection>
> <esql:pool>mm</esql:pool>
> <esql:execute-query>
> ...
> </esql:execute-query>
> </esql:connection>
> </category-list>
> </xsl:template>-->
>
> <xsl:template match="@*|*|text()|processing-instruction()">
> <xsl:copy>
> <xsl:apply-templates
> select="@*|*|text()|processing-instruction()"/>
> </xsl:copy>
> </xsl:template>
>
> </xsl:stylesheet>
>
> ---------------------------------------------------------------------
>
> Part of the list.xsp
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsp:page
> language="java"
> xmlns:xsp="http://apache.org/xsp"
>
> xmlns:session="http://apache.org/xsp/session/2.0"
> xmlns:mm="http://siemens.com/mm"
>
> xmlns:esql="http://apache.org/cocoon/SQL/v2">
> <page>
> ...
> <esql:connection>
> <esql:pool>mm</esql:pool>
> <esql:execute-query>
> ...
> </esql:execute-query>
> </esql:connection>
> </category-list>
>
> ...
> </page>
> </xsp:page>
>
> -----------------------------------------------------------
>
> The errors I get:
>
> org.apache.cocoon.ProcessingException: Language Exception:
> org.apache.cocoon.components.language.LanguageException: Error compiling
> videolist_xsp:
> Line 299, column 18: duplicate definition of variable _esql_connections
> in class org.apache.cocoon.www.xsp.videolist_xsp
> Line 300, column 34: duplicate definition of variable _esql_connection
> in class org.apache.cocoon.www.xsp.videolist_xsp
> Line 301, column 18: duplicate definition of variable _esql_queries in
> class org.apache.cocoon.www.xsp.videolist_xsp
> Line 302, column 22: duplicate definition of variable _esql_query in
> class org.apache.cocoon.www.xsp.videolist_xsp
> Line 303, column 25: duplicate definition of variable _esql_exception
> in class org.apache.cocoon.www.xsp.videolist_xsp
> Line 304, column 25: duplicate definition of variable
> _esql_exception_writer in class org.apache.cocoon.www.xsp.videolist_xsp
> Line 320, column 27: duplicate definition of method
> _esql_printObject(java.lang.Object, org.xml.sax.helpers.AttributesImpl)
> in class org.apache.cocoon.www.xsp.videolist_xsp
> Line 0, column 0:
> 7 errors
>
> P.S.: I looked at the esql.xsl file. If I understand it correctly, the
> global import statements and the global _esql_*-variables should only be
> generated when a xsp:page tag is found - and there is only one of those.
>
> //_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> // Andreas Ebert, Corporate Technology, Siemens AG
> // E-Mail: Andreas.Ebert@siemens.com NEW!
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>