You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Luke Reeves <lu...@oceanlake.com> on 2001/10/01 07:25:07 UTC

More ESQL problems

Sorry to bother everyone again, but I've got another problem with the ESQL
logicsheet.  Here's the code:

        <esql:execute-query>
          <esql:query>select ID from counters where link = 
             <esql:parameter
type="string"><xsp:expr>request.getParameter("file")
             </xsp:expr></esql:parameter></esql:query>
          <esql:results>
            <xsp:logic>
             java.lang.String useragent;
             java.lang.String fileid;
             fileid = <esql:get-string column="ID"/>;
            </xsp:logic>

I'm trying to grab the ID column value and assign it to a Java string object
for use in a further object; my site is littered with this methodology, and
it usually works.  However this code gives me the following error:

java.lang.Exception: XSP Java Compiler: Compilation failed for
_download.java
373: Incompatible type for =. Can't convert org.w3c.dom.Node to
java.lang.String.
             fileid = 
                    ^
1 error


	at
org.apache.cocoon.processor.xsp.language.java.XSPJavaProcessor.compile(XSPJa
vaProcessor.java:146)
	at
org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:522)
	at org.apache.cocoon.Engine.handle(Engine.java:384)
	at org.apache.cocoon.Cocoon.service(Cocoon.java:183)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
	at
org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)
	at org.apache.jserv.JServConnection.run(JServConnection.java:188)
	at java.lang.Thread.run(Thread.java:498)

Instead of grabbing the value of the column as a string, it looks like the
ESQL sheet is grabbing a Node object.  The code that's generated by Cocoon
is:

	java.lang.String fileid;

	fileid = xspParentNode = xspCurrentNode;
	xspNodeStack.push(xspParentNode);
	xspCurrentNode = document.createElement("esql:get-string");
	xspParentNode.appendChild(xspCurrentNode);

Anyone know why the ESQL taglib is so confused? Thanks!

	Luke Reeves, Director of Development
	Oceanlake Commerce Inc.
	luke.reeves@oceanlake.com