This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Elements print sometimes only


> > I have the following xsl file that prints a header, middle section and
> a
> > footer--on each page.
>
> Can we see a sample of your xml, too, please? With dummy element and
> attribute values if the data is sensitive.
>
> Michael

Certainly.  I reposted the xslt file below as well for ease of access. Thank
you.  Tamre


<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="copy of statement4.xsl"?>

<statement>
<title>CAPITAL ACCOUNT STATEMENT</title>
<stmtPeriod>04/01/01 - 04/30/01</stmtPeriod>
<text>Beginning Balance:</text>

<accountInfo>
<acctnum>7BR7</acctnum>
<accttitle>Capital Account</accttitle>
<beginBal>143006.56</beginBal>
<taxid>13-4055774</taxid>
<acctname>CAPITAL MARKETS(EXP)</acctname>
<address1>267 WALL ST</address1>
<address2>STE 155</address2>
<city>NEW YORK,</city>
<state> NY</state>
<zip> 10005</zip>

<transactions beginBal="123568.90">
<transaction>
<date>04/02/01</date>
<long>1</long>
<short></short>
<description>CLR BL99  This is just regular text that I am testing for
wrapping purposes.</description>
<priceCode>CLR</priceCode>
<amount>122.50</amount>
<ledgerBalance></ledgerBalance>
</transaction>

<transaction>
<date>04/02/01</date>
<long>2</long>
<short></short>
<description>CLR BL99</description>
<priceCode>CLR</priceCode>
<amount>3622.50</amount>
<ledgerBalance></ledgerBalance>
</transaction>

<transaction>
<date>04/02/01</date>
<long>3</long>
<short></short>
<description>CLR BL99</description>
<priceCode>CLR</priceCode>
<amount>45622.50</amount>
<ledgerBalance></ledgerBalance>
</transaction>

<transaction>
<date>04/02/01</date>
<long>4</long>
<short></short>
<description>CLR BL99</description>
<priceCode>CLR</priceCode>
<amount>622.50</amount>
<ledgerBalance></ledgerBalance>
</transaction>

<transaction>
<date>04/02/01</date>
<long>5</long>
<short></short>
<description>CLR BL99</description>
<priceCode>CLR</priceCode>
<amount>922.50</amount>
<ledgerBalance></ledgerBalance>
</transaction>

<transaction>
<date>04/02/01</date>
<long>6</long>
<short></short>
<description>CLR BL99</description>
<priceCode>CLR</priceCode>
<amount>10622.50</amount>
<ledgerBalance></ledgerBalance>
</transaction>

<transaction>
<date>04/02/01</date>
<long>7</long>
<short></short>
<description>CLR BL99</description>
<priceCode>CLR</priceCode>
<amount>622.50</amount>
</transaction>

<transaction>
<date>04/02/01</date>
<long>8</long>
<short></short>
<description>CLR BL99</description>
<priceCode>CLR</priceCode>
<amount>322.50</amount>
</transaction>



<transaction>
<date>04/02/01</date>
<long>9</long>
<short></short>
<description>CLR BL99</description>
<priceCode>CLR</priceCode>
<amount>3622.50</amount>
<ledgerBalance></ledgerBalance>
</transaction>

<transaction>
<date>04/02/01</date>
<long>10</long>
<short></short>
<description>CLR BL99</description>
<priceCode>CLR</priceCode>
<amount>45622.50</amount>
<ledgerBalance></ledgerBalance>
</transaction>

<transaction>
<date>04/02/01</date>
<long>11</long>
<short></short>
<description>CLR BL99</description>
<priceCode>CLR</priceCode>
<amount>622.50</amount>
<ledgerBalance></ledgerBalance>
</transaction>

<transaction>
<date>04/02/01</date>
<long>12</long>
<short></short>
<description>CLR BL99</description>
<priceCode>CLR</priceCode>
<amount>922.50</amount>
<ledgerBalance></ledgerBalance>
</transaction>

<transaction>
<date>04/02/01</date>
<long>13</long>
<short></short>
<description>CLR BL99</description>
<priceCode>CLR</priceCode>
<amount>10622.50</amount>
<ledgerBalance></ledgerBalance>
</transaction>

<transaction>
<date>04/02/01</date>
<long>14</long>
<short></short>
<description>CLR BL99</description>
<priceCode>CLR</priceCode>
<amount>622.50</amount>
</transaction>

<transaction>
<date>04/02/01</date>
<long>15</long>
<short></short>
<description>CLR BL99</description>
<priceCode>CLR</priceCode>
<amount>322.50</amount>
</transaction>

</transactions>
</accountInfo>

<pagefoot>THIS SUB-ACCOUNT IS BENEFICIALLY OWNED BY CAPITAL MARKETS AND THE
SECURITIES AND CASH IN THE ACCOUNT ARE NOT THE PROPERTY OF ANY OTHER ENTITY
OR INDIVIDUAL.  WE CARRY MULTIPLE ACCOUNTS OWNED BY LOUIS CAPITAL MARKETS.
THE TOTAL VALUE OF THESE ASSETS CAN ONLY BE DETERMINED BY ADDING TOGETHER
THE VALUES OF ALL RELATED ACCOUNTS, INCLUDING ACCOUNTS WITH NEGATIVE
VALUE.</pagefoot>

</statement>



******************************
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
<link rel="Stylesheet" href="statement.css" type="text/css"/>
</head>

<body>
<xsl:for-each select="statement/accountInfo">

<xsl:call-template name="pagehead">
</xsl:call-template>

<xsl:call-template name="pagetable">
</xsl:call-template>

</xsl:for-each> <!--statement/accountInfo-->

<xsl:call-template name="pagefoot">
</xsl:call-template>

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

<xsl:template name="pagehead">
<DIV style="position: relative; top:4px; width:4in;left:6in">
<xsl:value-of select="acctnum"/>

<span class="shiftright">
<xsl:value-of select="taxid"/>
</span>


<span class="shiftrightb">
<xsl:value-of select="/statement/stmtPeriod"/>
</span>
</DIV>

<DIV style="position: relative; height:.75in; width:3in;left -2px;top:10px;
font-size: 8pt; border:2px solid pink;">
<xsl:value-of select="acctname"/>
<br/>
<xsl:value-of select="address1"/>
<xsl:value-of select="address2"/>
<br/>
<xsl:value-of select="city"/>
<xsl:value-of select="state"/>
<xsl:value-of select="zip"/>
</DIV>

<DIV style="position: relative; height:.5in; width:4in;left:
3in;top:-.5in;">
<h4>
<xsl:value-of select="/statement/title"/></h4>
</DIV>

<DIV style="position: relative; top:2px; border:2px solid orange;">
<table>
<tr>
<th align="left" width="65px">DATE</th>
<th width="70px">LONG<br/>(Bought or<br/> Received)</th>
<th width="70px">SHORT<br/>(Sold or<br/> Delivered)</th>
<th align="left" width="225px">DESCRIPTION</th>
<th width="50px">PRICE/<br/>CODE</th>
<th align="right" width="160px">DEBIT</th>
<th align="right" width="160px">CREDIT</th>
<th align="right" width="180px">LEDGER<br/>BALANCE</th>
</tr>
</table>
</DIV>
<hr style="position: relative; top:7px;"/>
</xsl:template>


<xsl:template name="pagetable">
<DIV style="position: relative; top:10px;">
<table id="table1">
<caption><xsl:value-of
select="/statement/accountInfo/acctnum"/>&#xa0;<!--whitespace between
elements--><xsl:value-of
select="/statement/accountInfo/accttitle"/></caption>

<caption id="caption2">
<xsl:value-of select="/statement/text"/>&#xa0;<xsl:value-of
select="format-number(transactions/@beginBal,'#,##0.00DB;#,##0.00CR')"/></ca
ption>


<xsl:for-each select="transactions/transaction">

   <xsl:variable name="rowsPerPage" select="8"/>

<xsl:call-template name="rowcount">
<!--<xsl:with-param name="start-val" select="1"/>-->
<!--<xsl:with-param name="end-val" select="10"/>-->
</xsl:call-template>

   <xsl:if test="position() mod $rowsPerPage=0">

   <xsl:text disable-output-escaping="yes">
   <![CDATA[</table></DIV>]]>
   </xsl:text>


<xsl:call-template name="pagefoot">
   </xsl:call-template>

   <xsl:call-template name="pagehead">
   </xsl:call-template>

   <xsl:text disable-output-escaping="yes">
   <![CDATA[<DIV><table>]]>
   </xsl:text>
   </xsl:if>

</xsl:for-each> <!--transactions/transaction-->
</table>
</DIV>
</xsl:template>

<xsl:template name="rowcount">
<tr>

<td width="65px" align="left"><xsl:value-of select="date"/>&#xa0;</td>
<td width="70px"><xsl:value-of select="long"/>&#xa0;</td>
<td width="70px"><xsl:value-of select="short"/>&#xa0;</td>
<td width="225px"><xsl:value-of select="description"/>&#xa0;</td>
<td width="50px" align="center"><xsl:value-of
select="priceCode"/>&#xa0;</td>


<td width="160px" align="right">
<xsl:if test="substring(amount,1,1)!='-'">
<xsl:value-of
select="format-number(amount,'#,##0.00')"/>&#xa0;</xsl:if></td>

<td width="160px" align="right">
<xsl:if test="substring(amount,1,1)='-'">
<xsl:value-of
select="format-number(amount,'#,##0.00')"/>&#xa0;</xsl:if></td>


<td width="180px" align="right">
<xsl:choose>
<xsl:when test="position()=1">
<xsl:value-of
select="format-number(amount+//@beginBal,'#,##0.00DB;#,##0.00CR')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of
select="format-number(amount+sum(preceding-sibling::transaction/amount)+//@b
eginBal,'#,##0.00DB;#,##0.00CR')"/>&#xa0;
</xsl:otherwise>
</xsl:choose>

</td>
</tr>
<!--</xsl:if>-->
</xsl:template>


<xsl:template name="pagefoot">
<h6><DIV id="footer">
<xsl:value-of select="//pagefoot"/>
</DIV></h6>
</xsl:template>

</xsl:stylesheet>
----- Original Message -----
From: "Michael Beddow" <mbnospam@mbeddow.net>
To: <xsl-list@lists.mulberrytech.com>
Sent: Saturday, July 21, 2001 1:51 AM
Subject: Re: [xsl] Elements print sometimes only


> On Friday, July 20, 2001 11:30 PM
> Tamre2 wrote:
>
> > I have the following xsl file that prints a header, middle section and
> a
> > footer--on each page.
>
> Can we see a sample of your xml, too, please? With dummy element and
> attribute values if the data is sensitive.
>
> Michael
> ---------------------------------------------------------
> Michael Beddow   http://www.mbeddow.net/
> XML and the Humanities page:  http://xml.lexilog.org.uk/
> ---------------------------------------------------------
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]