You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Darrel Riekhof <da...@tririga.com> on 2001/07/17 19:49:44 UTC
XSL:FO help
Say you have an XML file that looks like this:
<?xml version = "1.0"?>
<PO type="Purchase Order">
<note>
blah blah blah<br/>
<strong>blah blah blah</strong>
<p/>
<em>blah blah blah</em>
<u>blah blah blah</u>
<p/>
<ol>
<li>blah</li>
<li>blah</li>
<li>blah</li>
</ol>
<p/>
<strong>blah <em>blah <u>blah </u>blah </em>blah</strong>
</note>
</PO>
I want to mark up the text in the resulting PDF file according to the tags
(strong=bold, em=italics, etc.) I'm a newbie with XSL, and I can't figure
out how to write the XSL so it transforms this XML into the correct FO. Can
anyone recommend a good XSL book or reference that would help me with this,
or better yet, give me some XSL:FO that does this?
Darrel
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: XSL:FO help
Posted by Uli Mayring <ul...@denic.de>.
On Tue, 17 Jul 2001, Darrel Riekhof wrote:
> I want to mark up the text in the resulting PDF file according to the tags
> (strong=bold, em=italics, etc.) I'm a newbie with XSL, and I can't figure
> out how to write the XSL so it transforms this XML into the correct FO. Can
> anyone recommend a good XSL book or reference that would help me with this,
> or better yet, give me some XSL:FO that does this?
Here are some useful general formatting templates, as you can see it's
real easy:
<xsl:template match="strong">
<fo:inline font-weight="bold">
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
<xsl:template match="em">
<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>
<xsl:template match="font-size">
<fo:inline font-size="{@value}">
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
<xsl:template match="line-height">
<fo:inline line-height="{@value}">
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
Ulrich
--
Ulrich Mayring
DENIC eG, Softwareentwicklung
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>