More ESQL problems

2001-09-30 Thread Luke Reeves
Title: 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:queryselect ID from counters where link = 
 esql:parameter type=stringxsp:exprrequest.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(XSPJavaProcessor.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.
 [EMAIL PROTECTED]





RE: More ESQL problems

2001-09-30 Thread Luke Reeves
Title: Message



Yes, it's a reply 
to my own post. Found the problem. I moved the xsp:logic 
tags to inside a esql:row-results like so:
 
esql:row-results 
xsp:logic 
java.lang.String 
useragent; 
java.lang.String fileid;

 
fileid = esql:get-string 
column="ID"/; 
/xsp:logic 
/esql:row-resultsAnd it worked just 
fine.

 Luke

  
  -Original Message-From: Luke Reeves 
  [mailto:[EMAIL PROTECTED]] Sent: October 1, 2001 1:25 
  AMTo: '[EMAIL PROTECTED]'Subject: 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:queryselect ID from counters where link =  
  esql:parameter 
  type="string"xsp:exprrequest.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(XSPJavaProcessor.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. 
   [EMAIL PROTECTED]