XML prints a blank page, please help!

Discussion in 'XML' started by Kragspire, Aug 18, 2004.

  1. Kragspire

    Kragspire Guest

    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>
    -------------------------------------------------------------------------------
    Sorry about the format, it didn't seem to line up too well in this
    message textbox.
     
    Kragspire, Aug 18, 2004
    #1
    1. Advertising

  2. On 18 Aug 2004 13:03:14 -0700, (Kragspire) wrote:

    > <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>
    --
    Robin Johnson
    Lead Developer, enCircle Solutions Ltd.
    first initial last name at encircle dot co dot uk
     
    Robin Johnson, Aug 19, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    7
    Views:
    780
  2. KK
    Replies:
    2
    Views:
    622
    Big Brian
    Oct 14, 2003
  3. Juerg Beck

    FF prints only first page

    Juerg Beck, Aug 30, 2007, in forum: HTML
    Replies:
    6
    Views:
    621
    Jonathan N. Little
    Aug 30, 2007
  4. newzguy

    XP prints out html not page ?

    newzguy, Aug 29, 2004, in forum: Perl Misc
    Replies:
    2
    Views:
    96
    Ian Wilson
    Aug 29, 2004
  5. Blue
    Replies:
    6
    Views:
    101
    Erik Wasser
    Jun 6, 2006
Loading...

Share This Page