You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Olivier Eymere <li...@intergate.ca> on 2001/02/21 09:36:51 UTC

error with xsp code

This should be pretty easy...

I have been trying to use the code below that was posted to the group
about 10 days ago:

<?xml version="1.0"?>
<!-- edited with XML Spy v3.5 (http://www.xmlspy.com) by john menke
(eagle
information systems) -->
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<xsp:page language="java"
xmlns:xsp="http://www.apache.org/1999/XSP/Core">
<page title="My Page">
<xsp:logic> String[] param = request.getParameterValues("dummy");
String stylesheet;
if (param != null) {
stylesheet = "pdf.xsl";
} else {
stylesheet = "html.xsl";
} </xsp:logic>
<xsp:pi target="xml-stylesheet">
                href="<xsp:expr>stylesheet</xsp:expr>"
                type="text/xsl"
</xsp:pi>

When I try to run the code I get the following error:

java.lang.Exception: XSP Java Compiler: Compilation failed for
_test.java
28: Type expected.
  if (param != null) {
  ^
1 error

Can anyone help me get around this error?