At 05:35 PM 2/4/2004, you wrote:
my xml input file should read as follows
<ROOT>
<TABLE>
<DPROW>
<OBJECT>2</OBJECT>
</DPROW>
</TABLE>
<TABLE>
<DPROW>
<OBJECT>1</OBJECT>
</DPROW>
<TABLE>
<DPROW>
<OBJECT>3</OBJECT>
<OBJECT>4</OBJECT>
</DPROW>
</TABLE><- Closing table tag omitted in error.
</TABLE>
</ROOT>
Also validating my complete xml file within xmlspy returns no validation
errors.
OK, then your complete file is somewhat different than your example. The
example
still isn't quite right, because it has no root element, which means that
there are
two <TABLE> elements at the root. However, I made the adjustment of adding a
root element surrounding what you have (as above), and then took what you
provided as a simplified stylesheet earlier and added the root element of
xsl:stylesheet to that as well as follows:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/199/XSL/Format">
<xsl:template match="TABLE">
<fo:table table-layout="fixed" width="7.5in"
space-before.optimum="5pt">
<xsl:for-each select="DPROW/OBJECT">
<fo:table-column column-width="{6.26 div last()}in"/>
</xsl:for-each>
<fo:table-body>
<xsl:apply-templates/>
</fo:table-body>
</fo:table>
</xsl:template>
</xsl:stylesheet>
I then ran the test file with that stylesheet through xalan, and I got this
result from the transformation:
<?xml version="1.0" encoding="UTF-8"?>
<fo:table xmlns:fo="http://www.w3.org/199/XSL/Format"
space-before.optimum="5pt" width="7.5in"
table-layout="fixed"><fo:table-column column-width="6.26in"/><fo:table-body>
2
</fo:table-body></fo:table>
<fo:table xmlns:fo="http://www.w3.org/199/XSL/Format"
space-before.optimum="5pt" width="7.5in"
table-layout="fixed"><fo:table-column column-width="6.26in"/><fo:table-body>
1
<fo:table space-before.optimum="5pt" width="7.5in"
table-layout="fixed"><fo:table-column
column-width="3.13in"/><fo:table-column column-width="3.13in"/><fo:table-body>
3
4
</fo:table-body></fo:table>
</fo:table-body></fo:table>
I don't see any problems with the output, but I gather that you do. What
did you expect to come out differently?
--Chris
----------------------------------------------------------------------------------------
Texterity ~ Digital Delivery Made Simple
----------------------------------------------------------------------------------------
Chris Loschen, XML Developer
Texterity, Inc.
144 Turnpike Road
Southborough, MA 01772 USA
tel: +1.508.804.3033
fax: +1.508.804.3110
email: loschen(_at_)texterity(_dot_)com
http://www.texterity.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list