W3C home > Mailing lists > Public > www-xsl-fo@w3.org > September 2003

fo:table - how do you wrap around?

From: <michelleaiken-webboards9999@mailblocks.com>
Date: Thu, 04 Sep 2003 13:01:04 -0700
Message-Id: <8C541366825B088-3C0-67C@App2>
To: www-xsl-fo@w3.org


I have an XML file that looks something like this:

<?xml version="1.0" encoding="utf-8"?>
  <Customer Name="Bill McDonald" idx="A">
    <A1>925 Edward St.</A1>

There can be any number of these Contact elements.

Right now I am using a fo:table  to display them.
Here is a piece of the XSL:

<xsl:template match="AddressInfo">
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
        <fo:simple-page-master master-name="my-page">
        <fo:region-body margin="1.5cm" margin-right="1cm"/>
         <fo:region-after extent="0.5cm" margin="1.5cm" 
margin-bottom="1cm" />

    <fo:page-sequence master-reference="my-page">

        <fo:flow flow-name="xsl-region-body">
            <fo:table border="0.2pt solid black">
            <fo:table-column column-width="12cm"/>
		    <xsl:apply-templates select="Contact" />

<xsl:template xmlns:fo="http://www.w3.org/1999/XSL/Format" 

<fo:table-row keep-with-next.within-column="always"><xsl:attribute 
name="font"><xsl:value-of select="//BaseFont"/></xsl:attribute>
      <fo:table-cell padding-start="4pt" text-align="left">
        <fo:block> <xsl:value-of select="@Name" /></fo:block>

... more templates for A1, city, state, etc.


The display looks something like this

Customer1 Name
Customer1 Address
Customer1 City, State, Zip
Customer2 Name
Customer2 Address
Customer2 City, State, Zip
Customer3 Name
Customer3 Address
Customer3 City, State, Zip
Customer4 Name
Customer4 Address
Customer4 City, State, Zip

I want it to look like this:

Customer1 Name                            |  Customer2 Name
Customer1 Address                        |  Customer2 Address           

Customer1 City, State, Zip             |  Customer2 City, State, Zip
Customer3 Name                            |  Customer4 Name
Customer3 Address                        |  Customer4 Address           

Customer3 City, State, Zip             |  Customer4 City, State, Zip

I can't just add another column because I need to loop through all the 
contacts in the xml file, and the second column would be the same as 
the first, just different data.  Anyone know how I can do this?  Is 
there some kind of table wrap-around attribute?

Thanks in advance for any help!

Received on Friday, 5 September 2003 15:38:09 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:28 UTC