This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Need help with XSL-FO


First, thank you all for the help you've given me already this week.

I am using XML Spy and attempting a transformation to render my XML as a PDF. XML Spy uses Xalan and FOP. I created the following XSL based on a terrific article by Doug Tidwell. I am an ABSOULTE BEGINNER and can't figure out why I keep getting errors.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:fo="http://www.w3.org/1999/XSL/Format";>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
<xsl:output method="text"/>

<xsl:processing-instruction name="cocoon-format" type="text/xslfo"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
<fo:layout-master-set>
<fo:simple-page-master master-name="standard">
<fo:region-body region-name="body" extent="1.1in" page-width="8.5in" page-height="11in" margin-top="1in" margin-bottom="1in" margin-left="1in" margin-right="1in"/>
<fo:region-before extent=".75in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="standard">
<fo:flow flow-name="body">
<xsl:apply-templates select="Head1"/>
<xsl:apply-templates select="Head2"/>
<xsl:apply-templates select="para"/>
</fo:flow>
</fo:page-sequence>
</fo:root>

<!-- Template to apply to all Head1 nodes -->
<xsl:template match="Head1">
<fo:block font-family="Helvetica" font-size="16pt" space-before.minimum="12pt" space-after="12pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<!-- Template to apply to all Head2 nodes -->
<xsl:template match="Head2">
<fo:block font-family="Helvetica" font-size="14pt" space-before.minimum="12pt" space-after="12pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<!-- Template to apply to all para nodes -->
<xsl:template match="para">
<fo:block font-family="Helvetica" font-size="10pt" space-after="6pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
</xsl:stylesheet>


I appreciate any help you fine people can give me, and I apologize for asking so many questions. I've ordered the XSL-FO book that O'Reilly is producing, but its not even available until 8/15. I'm just a tech writer with a few XML (and XSLT, and XPATH, and XML Schema) books, the internet, and a project to complete.

Thanks again,
Sandy




XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]