You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by marco <m....@pisa.iol.it> on 2000/10/18 16:42:06 UTC

XSP ERROR

  I have a strange problem that I am not able to understand: it regards
XSP. When I insert the following XSP code (suggested by Roobin):
................
<xsl:choose>
<xsl:when test="$sceltau='generale'">
<xsp:logic>
String Body = "<xsl:value-of select="./Generale/Descrizione"/>";
</xsp:logic>
</xsl:when>
<xsl:when test="$sceltau='amore'">
<xsp:logic>
String Body = "<xsl:value-of
select="Aspetto[@code='Amore']/Descrizioneaspetto"/>";
</xsp:logic>
</xsl:when>
..........................

I obtain the following mistakes:

blockquote><pre>java.lang.Exception: XSP Java Compiler: Compilation
failed for _prova15.java
105: String not terminated at end of line.
String Body = "
              ^
106: ';' expected.
  Per gli Arieti anno nuovo sorge con Giove in transito nel segno, e ci
resta fino a febbraio.
^
107: String not terminated at end of line.
         ";
         ^
3 errors


 at
org.apache.cocoon.processor.xsp.language.java.XSPJavaProcessor.compile(XSPJavaProcessor.java,
Compiled Code)
 at
org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java,
Compiled Code)
 at org.apache.cocoon.Engine.handle(Engine.java, Compiled Code)
 at org.apache.cocoon.Cocoon.service(Cocoon.java, Compiled Code)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
 at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
 at org.apache.tomcat.core.ContextManager.service(ContextManager.java,
Compiled Code)
 at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java,
Compiled Code)
 at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
Compiled Code)
 at java.lang.Thread.run(Thread.java, Compiled Code)


Why I obtain these mistakes?
What they mean?
Please help me.
Marco
m.spinetti@pisa.iol.it






Re: XSP ERROR

Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 18 Oct 2000, marco wrote:

> 
>   I have a strange problem that I am not able to understand: it regards
> XSP. When I insert the following XSP code (suggested by Roobin):
> ................
> <xsl:choose>
> <xsl:when test="$sceltau='generale'">
> <xsp:logic>
> String Body = "<xsl:value-of select="./Generale/Descrizione"/>";
> </xsp:logic>
> </xsl:when>
> <xsl:when test="$sceltau='amore'">
> <xsp:logic>
> String Body = "<xsl:value-of
> select="Aspetto[@code='Amore']/Descrizioneaspetto"/>";
> </xsp:logic>
> </xsl:when>
> ..........................
> 
> I obtain the following mistakes:
> 
> blockquote><pre>java.lang.Exception: XSP Java Compiler: Compilation
> failed for _prova15.java
> 105: String not terminated at end of line.
> String Body = "
>               ^
> 106: ';' expected.
>   Per gli Arieti anno nuovo sorge con Giove in transito nel segno, e ci
> resta fino a febbraio.
> ^
> 107: String not terminated at end of line.
>          ";
>          ^
> 3 errors
> 
> 
>  at
> org.apache.cocoon.processor.xsp.language.java.XSPJavaProcessor.compile(XSPJavaProcessor.java,
> Compiled Code)
>  at
> org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java,
> Compiled Code)
>  at org.apache.cocoon.Engine.handle(Engine.java, Compiled Code)
>  at org.apache.cocoon.Cocoon.service(Cocoon.java, Compiled Code)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
> Code)
>  at
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
> Compiled Code)
>  at org.apache.tomcat.core.ContextManager.service(ContextManager.java,
> Compiled Code)
>  at
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java,
> Compiled Code)
>  at
> org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
> Compiled Code)
>  at java.lang.Thread.run(Thread.java, Compiled Code)
> 
> 
> Why I obtain these mistakes?
> What they mean?

they mean that your xpath expression, "./Generale/Descrizione" resolves to
"\nPer gli Arieti anno nuovo sorge con Giove in transito nel segno, e ci
resta fino a febbraio.\n", and the new lines are screwing up the
java source code since your string declaration ends up looking
like this:

String Body = "
Per gli Arieti anno nuovo sorge con Giove in transito nel segno, e ci
resta fino a febbraio.
";

dealing with this can be tricky - jeremy quinn posted an example a few
days ago for doing so; you can also try looking at the get-nested-string
method used by the esql logicsheet.

- donald