This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Cocoon lib versions
- To: "Xsl-List (E-mail)" <xsl-list at mulberrytech dot com>
- Subject: Cocoon lib versions
- From: Anthony Ikeda <anthony dot ikeda at proxima-tech dot com>
- Date: Mon, 4 Dec 2000 09:23:13 +1100
- Reply-To: xsl-list at mulberrytech dot com
I seem to be getting problems using cocoon and relative libraries.
Which version of libs are required to run cocoon? Each download of Xerces,
Xalan and cocoon seem to have different versions of their libs.
I had a PDF stylesheet that works on my home computer but not on my work PC.
On my work PC I get:
using renderer org.apache.fop.render.pdf.PDFRenderer
using element mapping org.apache.fop.fo.StandardElementMapping
using element mapping org.apache.fop.svg.SVGElementMapping
building formatting object tree
WARNING: Unknown formatting object ^
But on my home PC I don't get this error.
Also I have set up a new webapp to use cocoon but it won't transform the
files. The browser just returns the file in text form. If I copy the files
to the cocoon dir then they work (when the above error does not occur).
Running the code worked the first time, but when I applied the media
attribute to the stylesheet declaration in the XML doc, it stopped
transforming all XML (even when I removed the media attribute!)
Here is my code:
XML(doc1.xml):
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="documentPDF.xsl"?>
<?cocoon-process type="xslt"?>
<document>
<bodycolor>#ffeedd</bodycolor>
<title>What XML means to me.</title>
<author>Anthony Ikeda</author>
<para>Welcome to the first [or second] testing of xml docs.</para>
<para>Hopefully it will test to see if the Explorer 5.5 program on this PC
is functioning properly.</para>
<para>XML seems to be the next greatest technology that I will be working
with. For me that is a great honour (well
maybe not an honour but it's going to be fun).</para>
<para>So far getting used to this new language has been a bit strange as the
syntax is very different to what I normally use</para>
<para>But I'm sure as I make use of it, my skills will improve and
perhaps I'll develop great web applications with my new skills.</para>
<para>Well it seems the XML to HTML conversion is successful. Next I would
like to try
creating PDF documents...
</para>
</document>
XSL (documentPDF.xsl):
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="document">
<xsl:processing-instruction name="cocoon-format">
type="text/xslfo"
</xsl:processing-instruction>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master
page-master-name="right"
margin-top="75pt"
margin-bottom="25pt"
margin-left="100pt"
margin-right="50pt">
<fo:region-body margin-bottom="50pt" />
<fo:region-after extent="25pt"/>
</fo:simple-page-master>
<fo:simple-page-master
page-master-name="left"
margin-top="75pt"
margin-bottom="25pt"
margin-left="50pt"
margin-right="100pt">
<fo:region-body margin-bottom="50pt" />
<fo:region-after extent="25pt"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence>
<fo:sequence-specification>
<fo:sequence-specifier-alternating
page-master-first="right"
page-master-odd="right"
page-master-even="left"/>
</fo:sequence-specification>
<fo:static-content flow-name="xsl-after">
<fo:block text-align-last="centered"
font-size="10pt">
<fo:page-number/>
</fo:block>
</fo:static-content>
<fo:flow>
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="document/title">
<fo:block font-size="36pt" text-align-last="centered"
space-before.optimum="24pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="para">
<fo:block font-size="12pt" text-align="left"
space-before.optimum="18pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
</xsl:stylesheet>
Cheers,
Anthony Ikeda,
Web Application Developer,
Proxima Technology,
Level 13,
181 Miller Street,
North Sydney
Australia
PH: +612-9458-1718
Mob: 041 624 5143
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list