cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathaniel Alfred" <Alfred.Nathan...@swx.com>
Subject RE: xsp and &lt; symbol problem
Date Wed, 27 Apr 2005 21:05:52 GMT
>-----Original Message-----
>From: Volker Bublitz [mailto:vbu@imatics.de]
>Sent: Mittwoch, 27. April 2005 11:57
>To: users@cocoon.apache.org
>Subject: Re: xsp and &lt; symbol problem
>
>
>i decided to attach my current  .xsp file since i can't get it 
>to work.  
>thanks for all your help.

>
>     String secondsql = "SELECT id FROM cmdb WHERE  
>bezeichnung='&lt;sql:substitute-value  
>xmlns:sql=\"http://apache.org/cocoon/SQL/2.0\"  
>sql:name=\"bezeichnung\"/&gt;' AND 
>kategorie='&lt;sql:substitute-value  
>xmlns:sql=\"http://apache.org/cocoon/SQL/2.0\"  
>sql:name=\"kategorie\"/&gt;' AND standort='&lt;sql:substitute-value  
>xmlns:sql=\"http://apache.org/cocoon/SQL/2.0\"  
>sql:name=\"standort\"/&gt;' AND admin='&lt;sql:substitute-value  
>xmlns:sql=\"http://apache.org/cocoon/SQL/2.0\"  
>sql:name=\"admin\"/&gt;'";
>

>       <sql:execute-query name="customer"  
>xmlns:sql="http://apache.org/cocoon/SQL/2.0">
>         <sql:query xmlns:sql="http://apache.org/cocoon/SQL/2.0">
>  	        <xsp:expr 
>disable-output-escaping="yes">secondsql</xsp:expr>
>         </sql:query>
>       <xsp:expr disable-output-escaping="yes">writeOutput()</xsp:expr>
>       </sql:execute-query>

What you need to understand is that Cocoon pipelines transport SAX events.  An <xsp:expr>
creates a character data event which will percolate down the pipeline.  None of the standard
transformers will try to parse these strings into XML again.

You have to generate any XML tags as such already in the XSP:

   <sql:query>
     SELECT id FROM cmdb
     WHERE bezeichnung='<sql:substitute-value sql:name="bezeichnung"/>' ...
   </sql:query>

But rather than using XSP-generator|SQL-transformer you should have a look at the esql logicsheet.
 That allows you to run the SQL inside the XSP and gives more control over conditional output
and formatting.

Btw for serious applications I would recommend to use neither SQL-transformer nor ESQL-logicsheet
for insert/update/delete operations.  These should always be incapsulated in Java classes
for proper transaction and exception handling.

HTH, Alfred.
 
 
This message is for the named person's use only. It may contain confidential, proprietary
or legally privileged information. No confidentiality or privilege is waived or lost by any
mistransmission. If you receive this message in error, please notify the sender urgently and
then immediately delete the message and any copies of it from your system. Please also immediately
destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail communications through their
networks. Any views expressed in this message are those of the individual sender, except where
the message states otherwise and the sender is authorised to state them to be the views of
the sender's company.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message