cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Naquin, Beth" <Beth.Naq...@morpho.com>
Subject RE: Multiple conditions in an XSP if statement
Date Mon, 01 Jul 2002 22:16:23 GMT
I think the error comes from the fact that what you have written is not
valid XML, the && part I mean.  I tried this same thing in a logicsheet,
using a tool that validates XML, and it was not considered well-formed XML.


I got around it by using CDATA on the 'if' line like this:

<![CDATA[
  if( <xsp-session:get-attribute name="state"/> == null &&
<xsp-request:get-parameter name="state"/> == null ){]]><![CDATA[
       ]]>
.. the rest of your code ...



-----Original Message-----
From: Matthew Hailstone [mailto:matthew.hailstone@waterford.org]
Sent: Monday, July 01, 2002 3:10 PM
To: cocoon-users@xml.apache.org
Subject: Multiple conditions in an XSP if statement


I am trying to implement an XSP that uses the following if statement.
This might be extremely simple. I think I remember seeing a URL that in
the User Documentation section that provided an example of code to use
inside an XSP page including a CDATA section. I can't seem to find it
anymore. I simply would like to know how to write the following if
statement with or without a CDATA section. (I've forgotten how the CDATA
section is used also.) Any quick help/reminder would be appreciated.

          if( <xsp-session:get-attribute name="state"/> == null &&
<xsp-request:get-parameter name="state"/> == null ){
            <field id="state" label="State" type="select"
selection="multiple">
              <esql:connection>
                <esql:pool>testdb</esql:pool>
                <esql:execute-query>
                  <esql:query>select distinct state from
state_table</esql:query>
                  <esql:results>
                    <esql:row-results>
                      <value><esql:get-string column="state"/></value>
                    </esql:row-results>
                  </esql:results>
                </esql:execute-query>
              </esql:connection>
            </field>
          }

To document the error, I get the following "Internal server error" page:

type fatal

message The entity name must immediately follow the '&' in the entity
reference.

description org.apache.cocoon.ProcessingException: The entity name must
immediately follow the '&' in the entity reference.:
org.xml.sax.SAXParseException: The entity name must immediately follow
the '&' in the entity reference.

sender org.apache.cocoon.servlet.CocoonServlet

source Cocoon servlet

stack-trace

org.apache.cocoon.ProcessingException: The entity name must immediately
follow the '&' in the entity reference.: org.xml.sax.SAXParseException:
The entity name must immediately follow the '&' in the entity reference.

	at
org.apache.cocoon.generation.ServerPagesGenerator.setup(ServerPagesGener
ator.java:209)
	at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPi
peline(AbstractProcessingPipeline.java:370)
	at
org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline.set
upPipeline(CachingProcessingPipeline.java:287)
	at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process
(AbstractProcessingPipeline.java:493)
	at
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(
SerializeNode.java:142)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:83)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i
nvoke(PreparableMatchNode.java:157)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:107)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P
ipelineNode.java:158)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:107)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(
PipelinesNode.java:152)
	at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro
cessor.java:327)
	at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro
cessor.java:309)
	at
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(Moun
tNode.java:132)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:83)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i
nvoke(PreparableMatchNode.java:157)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:107)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P
ipelineNode.java:158)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:107)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(
PipelinesNode.java:152)
	at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro
cessor.java:327)
	at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro
cessor.java:309)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:585)
	at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:260)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:646)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
83)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:191)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:646)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
83)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234
9)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:646)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.java:170)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:644)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:171)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:644)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
83)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:174)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:646)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
83)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:40
5)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Protocol.java:376)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:50
8)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:518)
	at java.lang.Thread.run(Thread.java:479)

org.xml.sax.SAXParseException: The entity name must immediately follow
the '&' in the entity reference.

	at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java
:1162)
	at
org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
	at
org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
	at
org.apache.cocoon.components.language.markup.LogicsheetCodeGenerator.gen
erateCode(LogicsheetCodeGenerator.java:173)
	at
org.apache.cocoon.components.language.markup.AbstractMarkupLanguage.gene
rateCode(AbstractMarkupLanguage.java:384)
	at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.gen
erateSourcecode(ProgramGeneratorImpl.java:441)
	at
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.loa
d(ProgramGeneratorImpl.java:309)
	at
org.apache.cocoon.generation.ServerPagesGenerator.setup(ServerPagesGener
ator.java:203)
	at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPi
peline(AbstractProcessingPipeline.java:370)
	at
org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline.set
upPipeline(CachingProcessingPipeline.java:287)
	at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process
(AbstractProcessingPipeline.java:493)
	at
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(
SerializeNode.java:142)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:83)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i
nvoke(PreparableMatchNode.java:157)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:107)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P
ipelineNode.java:158)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:107)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(
PipelinesNode.java:152)
	at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro
cessor.java:327)
	at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro
cessor.java:309)
	at
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(Moun
tNode.java:132)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:83)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i
nvoke(PreparableMatchNode.java:157)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:107)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P
ipelineNode.java:158)
	at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:107)
	at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(
PipelinesNode.java:152)
	at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro
cessor.java:327)
	at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro
cessor.java:309)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:585)
	at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:260)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:646)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
83)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:191)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:646)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
83)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234
9)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:646)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.java:170)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:644)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:171)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:644)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
83)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:174)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
nvokeNext(StandardPipeline.java:646)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
83)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:40
5)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Protocol.java:376)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:50
8)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:518)
	at java.lang.Thread.run(Thread.java:479)


Thanks,

Matthew

---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>

Mime
View raw message