My final answer!!!

Finally, after 3 days of work, I found a replacement solution for the 
unescaping problem. The tip is to put SQL Transformer away, and to take the 
advantage of both the ESQL Logicsheet and the Util Logicsheet in the 
generating XSP page.

Here is how the XSP page looks like:
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page
           language="java"
           xmlns:xsp="http://apache.org/xsp";
           xmlns:xsp-request="http://apache.org/xsp/request/2.0";
           xmlns:util="http://apache.org/xsp/util/2.0";
           xmlns:esql="http://apache.org/cocoon/SQL/v2";>
<xsp:logic>
   private String getUnescapedTag(String tag, String str)
   {
     <![CDATA[return "<"+tag+">"+str+"</"+tag+">";]]>
   }
</xsp:logic>
<root>
<esql:connection>
   <esql:pool>BDConnection</esql:pool>
   <esql:execute-query>
     <esql:query><!-- the place for the request --></esql:query>
     <esql:results>
       <rowset>
         <esql:row-results>
           <row>
              <nomclient_txt><esql:get-string 
column="nomClient_TXT"/></nomclient_txt> <!-- normal string field -->
                <util:include-expr><util:expr><xsp:expr>getUnescapedTag("resume_txt", 
<esql:get-string 
column="resume_TXT"/>)</xsp:expr></util:expr></util:include-expr> <!-- 
unescaped string field -->
                ...
           </row>
         </esql:row-results>
       </rowset>
     </esql:results>
     <esql:no-results>
        <p>Sorry, no results!</p>
     </esql:no-results>
   </esql:execute-query>
</esql:connection>

</root>
</xsp:page>



Then, the sql2xml.xsl is not needed anymore, and here is the corrected 
sample of resume_long.xsl, the XML-to-FO stylesheet:

<xsl:template match="rowset"> <!-- main template for xslt transformation -->
<xsl:for-each select="row">
...
<xsl:apply-templates select="resumelong_txt"/> <!-- apply templates only on 
the specified child (resumelong_txt) -->
</xsl:template>

<xsl:template match="b">
<fo:inline font-weight="bold"><xsl:apply-templates/></fo:inline>
</xsl:template>

<xsl:template match="i">
<fo:inline font-style="italic"><xsl:apply-templates/></fo:inline>
</xsl:template>

<xsl:template match="u">
<fo:inline text-decoration="underline"><xsl:apply-templates/></fo:inline>
</xsl:template>

Now you can enjoy...

I know this is not the best answer, as long as the design of the pipeline 
is modified. But it is the only thing I found...


Florent, Soulière
Stagiaire e-Technologies
T-Systems Soleri
Groupe Deutsche Telekom
Notre métier: la convergence informatique et télécoms
Convergence is our Business
------------------------------------------------------------------------
tél.:    +33 4 37 65 24 26
fax:    +33 4 37 65 22 31
mail:   [EMAIL PROTECTED]
------------------------------------------------------------------------
www.t-systems.fr

At 14:45 02/04/02 +0200, you wrote:
>At 13:01 02/04/02 +0200, you wrote:
>>Florent
>>
>>I cannot get this to work - when I try and apply the first sheet
>>to the results of the database query (via the XSP page), then
>>it works great!  e.g. a <b> in the database field is kept as such
>>in the generated XML.  However, as soon as I apply the final
>>sheet (to generate the HTML), then the <b> becomes &lt;b&gt;
>>again.
>>
>>Any ideas on how to avoid this?
>
>Err... actually, this is *the* problem in all that.
>and please notice that when you replace <xsl:apply-templates .../>  by 
><xsl:copy-of select="."/>, you still get the unescaped <b> tags, as it 
>would be expected with apply-templates... would it be a 
>"apply-templates-specific" problem? what else could I do?
>
>Thank you in advance.
>
>Florent.
>
>>Thanks
>>Derek
>>
>> >>> [EMAIL PROTECTED] 02/04/2002 10:16:19 >>>
>>Sorry, there is a little mistake in the source of resume_long.txt:
>>replace the line containing        <xsl:apply-templates
>>select="sql:resumelong_txt/*"/>
>>with        <xsl:apply-templates select="sql:resumelong_txt"/>
>>
>>
>>---------------------------------------------------------------------
>>Please check that your question has not already been answered in the
>>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>>For additional commands, e-mail: <[EMAIL PROTECTED]>
>>
>>
>>---------------------------------------------------------------------
>>Please check that your question has not already been answered in the
>>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>>For additional commands, e-mail: <[EMAIL PROTECTED]>
>
>Florent, Soulière
>Stagiaire e-Technologies
>T-Systems Soleri
>Groupe Deutsche Telekom
>Notre métier: la convergence informatique et télécoms
>Convergence is our Business
>------------------------------------------------------------------------
>tél.:    +33 4 37 65 24 26
>fax:    +33 4 37 65 22 31
>mail:   [EMAIL PROTECTED]
>------------------------------------------------------------------------
>www.t-systems.fr
>
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>For additional commands, e-mail: <[EMAIL PROTECTED]>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to