W3C home > Mailing lists > Public > www-xsl-fo@w3.org > October 2008

empty table problem

From: fraagol <j.delaguila@dysmatica.es>
Date: Thu, 16 Oct 2008 05:31:48 -0700 (PDT)
Message-ID: <20012801.post@talk.nabble.com>
To: www-xsl-fo@w3.org

Hi all,
I have a XML document like this:

....
<documents>
    <document>
        ...
    </document>
    <document>
        ...
    </document>
</documents>

and a xsl like this:

<fo:block space-after="12">
			<fo:table table-layout="fixed" width="100%" border="1"
border-style="solid" border-color="#55A0dd">
				<fo:table-column />
				<fo:table-body>
						<xsl:apply-templates select="documents/document" />
				</fo:table-body>
			</fo:table>

		</fo:block>
.....

<xsl:template match="documents/document">
		<fo:table-row>
			<fo:table-cell>
				<fo:block font-size="8pt">
					<xsl:value-of select="name" />
				</fo:block>
			</fo:table-cell>
		</fo:table-row>
	</xsl:template>

the problem is when the tag <documents> doesn't contain any <document> tag,
so the table header is created but no row added. error:
fo:table-body is missing child elements. 

How could I manage this so when no document tag exists inside documents tag
nothing would  be displayed?
thanks!

-- 
View this message in context: http://www.nabble.com/empty-table-problem-tp20012801p20012801.html
Sent from the w3.org - www-xsl-fo mailing list archive at Nabble.com.
Received on Thursday, 16 October 2008 16:51:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 16 October 2008 16:51:24 GMT