On Dec 5, 2005, at 11:25, Elmström Johan wrote:

Unfortunately I'm having some problems setting up my templates, and I can't find any good examples.

I keep getting an exception 'element xsl:template not allowed in this position', but as soon as I move it, I get an exception saying element fo: is not bound.

Errm... I fear you're somewhat missing the point, but that's OK. That's why we're here :-) Although the Mulberry XSLT list is far better suited for XSLT-related questions.


I'm trying to create several templates which each build a <fo:table> an put these inside a main template.

There should be at least an xsl:template that constructs the fo:root (possibly including the layout-master-set). So, roughly...


<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0"> <xsl:decimal-format name="standard" decimal-separator="," grouping- separator="." infinity="INFINITY" minus-sign="-" NaN="ogiltigt nummer" percent="%" per-mille="m" zero-digit="0" digit="#" pattern- separator=";"/>

<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
        <fo:layout-master-set>
        <fo:simple-page-master master-name="content"
                margin-right="5mm" margin-left="5mm"
                        margin-bottom="5mm" margin-top="5mm"
                page-width="210mm" page-height="297mm">
                <fo:region-body margin-top="20mm" margin-bottom="20mm"/>
                <fo:region-before extent="20mm"/>
                <fo:region-after extent="20mm"/>
        </fo:simple-page-master>
        </fo:layout-master-set>
<fo:page-sequence master-reference="content">
  <fo:flow flow-name="xsl-region-body">
<fo:table table-layout="fixed" inline-progression- dimension.optimum="200mm" font-size="10px">
        <fo:table-column column-width="200mm" column-number="1" />
        <fo:table-body start-indent="0px" text-align="start">
            <fo:table-row>
              <fo:table-cell>
                <xsl:apply-templates select="tableTemplate" mode="blind"/>
              </fo:table-cell>
            </fo:table-row>
          </fo:table-body>
        </fo:table>
      </fo:flow>
    </fo:page-sequence>
  </fo:root>
</xsl:template>

<xsl:template match="tableTemplate" mode="blind">
  <fo:table table-layout="fixed" width="100%">
    <fo:table-column column-width="proportional-column-width(1)"/>
      <fo:table-body>
        <fo:table-row padding-bottom="0.5mm">
          <fo:table-cell>
            <fo:block font-family="Times Roman"
              font-style="italic"
              font-size="8pt">
                      TEST
            </fo:block>
          </fo:table-cell>
        </fo:table-row>
        <fo:table-row keep-with-previous="always">
          <fo:table-cell>
            <fo:block>
                TEMPLATE
            </fo:block>
          </fo:table-cell>
        </fo:table-row>
     </fo:table-body>
  </fo:table>
</xsl:template>
</xsl:stylesheet>

HTH!

Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to