You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "dbenoff@covad.net" <db...@covad.net> on 2003/09/04 22:42:23 UTC

Newbie: Transformer chaining?

Hi all,

I am trying (without much luck), to implement a simple 2-step
transformation.  The first step to provide the XSLT transformation, the
second is to look for empty table cells (<td></td>) and insert a space in
them.  Can any experienced Cocoon'ers explain how to do this?

Here's my sitemap setup:
    <map:match pattern="*.dox">
        <map:generate type="request" src="{1}" root-element="{1}"/>
        <map:transform type="xslt" src="{1}.xsl" />
        <map:transform type="xslt" src="tablefix.xsl" />
        <map:serialize type="html" />
    </map:match>

And here's the snippet I'm trying to use to do the table fix (which just
gives me a concatenated string of all element values):

<xsl:template match="td">
    <td>
        <xsl:choose>
            <!-- If cell has child nodes or contains text then output them
-->
            <xsl:when test="* or normalize-space()">
                <xsl:apply-templates/> 
            </xsl:when>
            <!-- Otherwise the cell is empty and we output a non-breaking
space -->
            <xsl:otherwise>
                <xsl:text>&#160;</xsl:text>
            </xsl:otherwise>
        </xsl:choose>
    </td>
</xsl:template>

Thanks a bunch,
David Benoff


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .



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


cocoon 2.1 and font embedding

Posted by Michael Jones <md...@uky.edu>.
Hi,

I'm using Cocoon 2.1, Tomcat 4.1.27 and sun's jdk1.4.2.  I've followed the
steps point for point here
http://cocoon.apache.org/2.1/userdocs/serializers/pdf-serializer.html,
trying to embed the Gentium font in a pdf.  In the sitemap I have -

<map:serializer logger="sitemap.serializer.fo2pdf" name="fo2pdf"
src="org.apache.cocoon.serialization.FOPSerializer"
mime-type="application/pdf">
 <user-config>fonts/config.xml</user-config>
</map:serializer>

And my config.xml is -

<configuration>
 <entry>
  <key>fontBaseDir</key>
  <value>.</value>
 </entry>
 <fonts>
  <font metrics-file="GenAltR1.xml" kerning="yes" embed-file="GenAltR1.ttf">
   <font-triplet name="GenAltR1" style="normal" weight="normal"/>
  </font>
  <font metrics-file="GenAltI1.xml" kerning="yes" embed-file="GenAltI1.ttf">
   <font-triplet name="GenAltI1" style="italic" weight="normal"/>
  </font>
 </fonts>
</configuration>

I know this question has been discussed before, and I've read the previous
archives, but there's been different pieces of advice on relative paths and
absolute paths.  I understand that with Cocoon 2.1, the <user-config>
directive can be relative to the sitemap.  I've deleted the cache-dir file
as instructed and all I get is '######' where there should be Unicode Greek.
I've grepped the logs for "FOPSerializer" and nothing is returned, so I'm
getting no help from the log files.  Any suggestions from people who have
successfully gotten this working?  Thanks in advance,

Sincerely,

-Michael Jones



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