namco
07 Jan 2009, 07:53 AM
I'm trying to get my head around xsl-fo and I've written a test page to try it out. The problem is that the xsl-fo table isn't rendering.
Here's the page:
http://www.stupendous-stuff.com/cdcatalog.xml
Here's the code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
<blog>
<entry>
<type>Blog</type>
<datelong>2nd Jan 2009</datelong>
<time>8:40pm</time>
</entry>
</blog>
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
- <fo:root>
- <xsl:template match="/">
- <xsl:for-each select="blog/entry">
- <fo:table-and-caption>
- <fo:table>
<fo:table-column column-width="25mm" />
- <fo:table-header>
- <fo:table-row>
- <fo:table-cell>
<fo:block font-weight="bold">Car</fo:block>
</fo:table-cell>
- <fo:table-cell>
<fo:block font-weight="bold">Price</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
- <fo:table-body>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>
<xsl:value-of select="type" />
</fo:block>
</fo:table-cell>
- <fo:table-cell>
- <fo:block>
<xsl:value-of select="datelong" />
</fo:block>
</fo:table-cell>
- <fo:table-cell>
- <fo:block>
<xsl:value-of select="time" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-and-caption>
</xsl:for-each>
</xsl:template>
</fo:root>
</xsl:stylesheet>
Could anyone help?
Thanks.
Here's the page:
http://www.stupendous-stuff.com/cdcatalog.xml
Here's the code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>
<blog>
<entry>
<type>Blog</type>
<datelong>2nd Jan 2009</datelong>
<time>8:40pm</time>
</entry>
</blog>
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
- <fo:root>
- <xsl:template match="/">
- <xsl:for-each select="blog/entry">
- <fo:table-and-caption>
- <fo:table>
<fo:table-column column-width="25mm" />
- <fo:table-header>
- <fo:table-row>
- <fo:table-cell>
<fo:block font-weight="bold">Car</fo:block>
</fo:table-cell>
- <fo:table-cell>
<fo:block font-weight="bold">Price</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
- <fo:table-body>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>
<xsl:value-of select="type" />
</fo:block>
</fo:table-cell>
- <fo:table-cell>
- <fo:block>
<xsl:value-of select="datelong" />
</fo:block>
</fo:table-cell>
- <fo:table-cell>
- <fo:block>
<xsl:value-of select="time" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-and-caption>
</xsl:for-each>
</xsl:template>
</fo:root>
</xsl:stylesheet>
Could anyone help?
Thanks.