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]

Table problem


My xml is as follows:
              .......
             <table-header>
                         ......
				<table-column-headers>
                         <table-column-header-rowA> <!-- My problem lies
here within this row -->
                                    <column-header lang="EN"
name="YEAR"></column-header>
						<column-header lang="EN" name="YEAR"></column-header>
						<column-header lang="EN" name="YEAR"></column-header>
						<column-header lang="EN" name="YEAR"></column-header>
     						<column-header lang="EN" name="YEAR">1995/96</column-header>
						<column-header lang="EN" name="YEAR">1996/97</column-header>
                                    <column-header lang="EN"
name="YEAR">1997/98</column-header>
						<column-header lang="EN" name="YEAR">1998/99</column-header>
                          </table-column-header-rowA>
                            <table-column-header-row>
						<column-header lang="EN" name="YEAR">1995/96</column-header>
						<column-header lang="EN" name="YEAR">1996/97</column-header>
						<column-header lang="EN" name="YEAR">1997/98</column-header>
						<column-header lang="EN" name="YEAR">1998/99</column-header>
						<column-header lang="EN" name="YEAR">1994/95</column-header>
						<column-header lang="EN" name="YEAR">1995/96</column-header>
						<column-header lang="EN" name="YEAR">1996/97</column-header>
						<column-header lang="EN" name="YEAR">1997/98</column-header>
					</table-column-header-row>
				</table-column-headers>
			</table-header>
                  .....


Required Output:
The code sits in a table with 9 columns, the aim is to produce the following
table header...

----------------------------------------------------------------------------
-------------
                                                     1995/96   1996/97
1997/98   1998/99
                                                     -------   -------  ----
---   -------
           1995/96    1996/97    1997/98   1998/99   1994/95   1995/96
1996/97   1997/98
----------------------------------------------------------------------------
-------------

The code:
I have the table code in place it is just filling the table header which is
the problem.

I tried something like this:

<!--The first section needed to retrieve all the years from
column-header-row (to produce the bottom row) -->
<xsl:for-each
select="./table-header/table-column-headers/table-column-header-row/column-h
eader">
            <xsl:sort select="." data-type="number" order="ascending"/>

         <fo:table-cell>

               <fo:block text-align="center">
                  <xsl:value-of select="."/>
               </fo:block>

        </fo:table-cell>
</xsl:for-each>

<!--The next section needed to retrieve all the values from
column-header-rowA (to produce the upper value and line for the last 4
columns) -->
<xsl:for-each
select="./table-header/table-column-headers/table-column-header-rowA/column-
header">
               <fo:table-cell>

               <fo:block text-align="center">
                  <xsl:value-of select="."/>
               </fo:block>

              <fo:block>
                   <fo:leader leader-length="1.2cm"
                        leader-pattern="rule"
                        rule-thickness="0.5pt" color="black"/>
              </fo:block>

            </fo:table-cell>

      </xsl:for-each>

I have tried so many combinations but with little success - Any suggestions
(table-column-headers XML can be changed if need be).

Thanks

Tanz



 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]