Actually, the problem is a problem of unwanted "re-escaping".

Here are some sample sources of mine:

the pipeline (from sitemap.xconf):
   <map:pipeline>
    <map:match pattern="gdr/resume">
     <map:generate src="gdr/resume.xsp" type="serverpages"/> <!-- 
generation of the page containing the database request -->
     <map:transform type="sql"> <!-- SQL Database query using the SQL 
Tranformer -->
      <map:parameter name="use-connection" value="gdr"/>
     </map:transform>
     <map:transform src="gdr/sql2xml.xsl"/> <!-- the unescaping stylesheet -->
     <map:transform src="gdr/resume_long.xsl"/> <!-- the "XML-to-FO" 
stylesheet -->
     <map:serialize type="xml"/><!-- in order to see directly the result in 
xml format before further serialization -->
    </map:match>
   </map:pipeline>



sql2xml.xsl:
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
   xmlns:fo="http://www.w3.org/1999/XSL/Format";
   xmlns:sql="http://apache.org/cocoon/SQL/2.0";>

   <xsl:template match="sql:resumelong_txt|sql:resume_txt"> <!-- the 2 
fields I want to unescape -->
    <xsl:copy>
     <xsl:value-of disable-output-escaping="yes" select="text()"/>
    </xsl:copy>
   </xsl:template>

<xsl:template match="@*|node()" priority="-1">
   <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
   </xsl:copy>
</xsl:template>

</xsl:stylesheet>



resume_long.xsl:
   <xsl:template match="sql:rowset"> <!-- main template for xslt 
transformation -->
     <xsl:for-each select="sql:row">
        ...
        <xsl:apply-templates select="sql:resumelong_txt/*"/>
   </xsl:template>

   <xsl:template match="sql:resumelong_txt"> <!-- template specific to 1 of 
the fields containing html -->
     enter <!-- markups to see if template is entered -->
     <xsl:apply-templates/>
     exit <!-- obviously, "enter" and "exit" are both displayed, but text 
that appears within is escaped!!! :-( -->
   </xsl:template>

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

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

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

Enjoy... ;-/

At 09:21 02/04/02 +0200, Derek Hohls wrote:
>Florent
>
>Do you think you could post an example of how you doing this -
>I am also struggling with this "database with tags" processing
>issue & would appreciate some help!
>
>Maybe there could be something to put together for one of the
>support sites (eg cocooncentre.org)?
>
>Thanks
>Derek
>
> >>> [EMAIL PROTECTED] 29/03/2002 07:03:11 >>>
>Hello,
>
>I already passed 2 days trying to solve my problem by myself, but I did
>not
>succeed...
>The situation:
>I use the SQL Transformer to get data from database. inside this data,
>
>there are fields containing XHTML (e.g. <b>this is bold text</b>). What
>I
>want to do with all the data is to produce a PDF document using FO.
>To accomplish such a thing, I use 2 XSL pages: one for "unescaping" the
>
>&lt;b&gt;, &lt;i&gt; and other XHTML tags into some valid XML-like tags
>
>(<b>, <i>, ...) with <xsl:value-of disable-output-escaping="yes">. And
>the
>other xsl page does the "big job" by transforming all the document into
>a
>FO document (including the XHTML tags, of course).
>
>The problem:
>Even if the unescaping works fine (I checked it by watching the output
>of
>the XSLT transformation of the "unescaping XSL page"), it seems that
>when I
>want to process the <b>, <i> & others with a standard
><xsl:apply-templates/>, they automatically come back to a non-escaped
>form.
>
>What I already tried:
>I tried to replace <xsl:apply-templates/> by a <xsl:copy-of .../>. And
>I
>saw that my XHTML tags were still unescaped, as expected. So I really
>wonder why they come back to escaped when applied with
>apply-templates...
>I tried to split the global process into 2 steps: with one pipeline, I
>get
>the unescaped intermediate result, that I store manually into an xml
>file,
>and then with another pipeline I read the intermediate file and push it
>
>into the "big job" XSLT page... And it works!
>
>So, I really would like to know what's wrong with this unescaping and
>chained-XSLT stuff... I know that this problems of integrating XML
>fragments into Cocoon's pipelines have always been sensitive, although
>the
>documentation have absolutely no care with this.
>
>If anyone can help, thank you in advance.
>
>
>Florent, Soulière
>Stagiaire e-Technologies Lyon
>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]>

Reply via email to