XML prints a blank page, please help!

K

Kragspire

I have some code that I would like to be able to print out a first
name on a new page of paper each time it runs. The problem I have is
when it reaches the end of the printing it produces a blank page. How
can I get rid of the blank page that prints out? Here is the source
code that I used to do this...

-------------------------------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
<html>
<title>Navy Claim Record</title>
<body>

<xsl:for-each select="Claims/Claim">
<div style="page-break-after:always">
<b>Contract Name: </b> <xsl:value-of select="ContractName"/><br/>
</div>

</xsl:for-each>

</body>
</html>
</xsl:template>

</xsl:stylesheet>
 
R

Robin Johnson

<xsl:for-each select="Claims/Claim">
<div style="page-break-after:always">
<b>Contract Name: </b> <xsl:value-of select="ContractName"/><br/>
</div>

</xsl:for-each>

It seems like bad behaviour on the part of whatever program is
printing your document, but you could try not forcing the page-break
on the last iteration:

<xsl:for-each select="Claims/Claim">
<div>
<xsl:if test="position() != last()">
<xsl:attribute name="style">
<xsl:text>page-break-after:always</xsl:text>
</xsl:attribute>
</xsl:if>
<b>Contract Name: </b>
<xsl:value-of select="ContractName"/>
<br/>
</div>
</xsl:for-each>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top