Thanks again for your replies.  I got the answer at

http://forums.devshed.com/t102219/s.html&highlight=xslt+columns

You'll be glad to know that I'm ordering an XSLT today.

Frank

-----Original Message-----
From: Jeremias Maerki [mailto:[EMAIL PROTECTED] 
Sent: 24 September 2004 01:23
To: [EMAIL PROTECTED]
Subject: [work] Re: Avery labels

This is an XSLT question, not really related to FOP. 
http://xml.apache.org/fop/maillist.html#xslt-mulberry

You're violating XML structure like this (just like M$ does with
WordML).
That's why you're getting the error. You can't program
spaghetti-code-style in XSLT the way you were trying. Everything is
highly hierarchical.

You should put the table-cell in a named xsl:template where you can pass
in the node to use for the address. Then maybe you can do something
along these lines, for example:

<xsl:for-each select="//client">
  <xsl:if test="position() mod 3 = 0"> <!--only take every third node-->
    <fo:table-row>
      <xsl:call-template name="my-cell">
        <xsl:with-param name="my-node" select="."/>
      </xsl:call-template/>
      <xsl:call-template name="my-cell">
        <xsl:with-param name="my-node"
select="following-sibling::client[1]"/>
      </xsl:call-template/>
      <xsl:call-template name="my-cell">
        <xsl:with-param name="my-node"
select="following-sibling::client[2]"/>
      </xsl:call-template/>
    </fo:table-row>
  </xsl:if>
</xsl:for-each>

Untested and without guarantees!

Get a good XSLT book. I recommend "XSLT and XPath - On The Edge" by Jeni
Tennison.

On 24.09.2004 12:05:04 Frank Daly wrote:
> Hi
> 
> I want to create an Avery labels report.  The labels I use have 3
> columns so I want a new row for the first, fourth, seventh, etc.  To
> this end I test the position and attempt to create a new row when
> position() modulus 3 = 1.
> 
> <xsl:for-each select="//client">
>   <xsl:if test="position() mod 3 =1">
>     <!-- new row -->
>     <fo:table-row>
>   </xsl:if>
> 
> I then put in the cell and my name and address.
> 
> I then have a second test
>   <xsl:if test="position() mod 3 =1">
>     </fo:table-row>
>   </xsl:if>
> </xsl:for-each>
> 
> Unfortunately I get the error below
> 
> The element type "fo:table-row" must be terminated by the matching
> end-tag "".
> 
> Could someone point me in the right direction please.



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-------------------Legal
Disclaimer---------------------------------------

The above electronic mail transmission is confidential and intended only
for the person to whom it is addressed. Its contents may be protected by
legal and/or professional privilege. Should it be received by you in
error please contact the sender at the above quoted email address. Any
unauthorised form of reproduction of this message is strictly
prohibited. The Institute does not guarantee the security of any
information electronically transmitted and is not liable if the
information contained in this communication is not a proper and complete
record of the message as transmitted by the sender nor for any delay in
its receipt.

------------------------------------------------------------------------
----------------



-------------------Legal  Disclaimer---------------------------------------

The above electronic mail transmission is confidential and intended only for 
the person to whom it is addressed. Its contents may be protected by legal 
and/or professional privilege. Should it be received by you in error please 
contact the sender at the above quoted email address. Any unauthorised form of 
reproduction of this message is strictly prohibited. The Institute does not 
guarantee the security of any information electronically transmitted and is not 
liable if the information contained in this communication is not a proper and 
complete record of the message as transmitted by the sender nor for any delay 
in its receipt.

----------------------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to