[xsl] xsl:fo and tables

Subject: [xsl] xsl:fo and tables
From: Johannes.Becker@xxxxxx
Date: Fri, 15 Nov 2002 14:40:58 +0100
Hi,

I want to create a page in pdf output with a table.

My Code so far:

<?xml version='1.0'?>
<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="/">
        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
            <fo:layout-master-set>
                <fo:simple-page-master master-name="firstPage"
                    page-height="29.7cm"
                    ...
                      <fo:region-after extent="1.5cm"/>
                </fo:simple-page-master>

                 <fo:simple-page-master master-name="main"
                    page-height="29.7cm"
                    ...
                      <fo:region-after extent="1.5cm"/>
                </fo:simple-page-master>

                <fo:page-sequence-master master-name="all">
                 <fo:single-page-master-reference master-reference="
firstPage">
                 </fo:single-page-master-reference>
                    <fo:repeatable-page-master-reference master-reference="
main">
                    </fo:repeatable-page-master-reference>
                </fo:page-sequence-master>

            </fo:layout-master-set>

            <fo:page-sequence master-reference="all">
                <fo:flow flow-name="xsl-region-body">
                    <fo:block break-after="page"><xsl:apply-templates
select="RESULTSET"/></fo:block>
                    <fo:block><xsl:apply-templates select="RESULTSET/CDRS
"/></fo:block>
                </fo:flow>
            </fo:page-sequence>
        </fo:root>
    </xsl:template>

<xsl:template match="RESULTSET">
    <fo:block
      font-size="18pt"
      font-family="Arial"
      space-after.optimum="0pt"
      background-color="silver"
      color="white"
      text-align="left">
     <xsl:value-of select="DATE/@date"/>
    </fo:block>
 </xsl:template>

<xsl:template match="RESULTSET/CDRS">
  <fo:table width="300pt">
    <fo:table-body>
      <xsl:for-each select="NUMBER">
        <fo:table-row>
           <fo:table-cell width="140pt">
             <fo:block><xsl:value-of select="@MD_CALLED_NUMBER"/></fo:block
>
           </fo:table-cell>
           <fo:table-cell width="150pt">
             <fo:block><xsl:value-of select="@MD_CHARGEABLE_IMSI"/></
fo:block>
           </fo:table-cell>
        </fo:table-row>
      </xsl:for-each>
    </fo:table-body>
  </fo:table>
</xsl:template>

</xsl:stylesheet>

But the part in the <xsl:template match="RESULTSET/CDRS">   where my table
should be created, doesn't do anything (won't create a table like I would
want to).

What is wrong with my code?

Thanks
Jonny


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


Current Thread