You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Frank Daly <fd...@cit.ie> on 2004/09/24 12:05:04 UTC

Avery labels

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.

Frank


-------------------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: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: [work] Re: Avery labels

Posted by Frank Daly <fd...@cit.ie>.
Thanks again.  This has to be the most polite and friendly user group
around!

Frank

-----Original Message-----
From: Clay Leeds [mailto:cleeds@medata.com] 
Sent: 24 September 2004 05:31
To: fop-user@xml.apache.org
Subject: Re: [work] Re: Avery labels

On Sep 24, 2004, at 9:13 AM, Frank Daly wrote:
> Many thanks for your thoughtful reply but I can't get it to work.
> Surely someone has come across this problem before and found a 
> solution.
>
> Frank

Someone probably has. That's why Jeremias was directing you to the XSLT 
list where someone probably has already come up with a nifty solution 
to your problem. The FOP Mailing List page[1] has links to the XSLT 
List (hosted at Mulberry Tech)[2] where you can ask your question. 
Better yet, the FOP Resources page has a section called Books, 
Tutorials, Articles[3] which has links to many resources (online and 
otherwise), where you can probably find the answer to your question. I 
recommend Dave Pawson's excellent XSL FAQ[4] (which covers XSLT & 
XSL-FO).

Hope this helps!

Web Maestro Clay

[1]
http://xml.apache.org/fop/maillist.html
[2]
http://www.mulberrytech.com/xsl/xsl-list
[3]
http://xml.apache.org/fop/resources.html#documents
[4]
http://www.dpawson.co.uk/xsl/xslfaq.html


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


-------------------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: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: [work] Re: Avery labels

Posted by Clay Leeds <cl...@medata.com>.
On Sep 24, 2004, at 9:13 AM, Frank Daly wrote:
> Many thanks for your thoughtful reply but I can't get it to work.
> Surely someone has come across this problem before and found a 
> solution.
>
> Frank

Someone probably has. That's why Jeremias was directing you to the XSLT 
list where someone probably has already come up with a nifty solution 
to your problem. The FOP Mailing List page[1] has links to the XSLT 
List (hosted at Mulberry Tech)[2] where you can ask your question. 
Better yet, the FOP Resources page has a section called Books, 
Tutorials, Articles[3] which has links to many resources (online and 
otherwise), where you can probably find the answer to your question. I 
recommend Dave Pawson's excellent XSL FAQ[4] (which covers XSLT & 
XSL-FO).

Hope this helps!

Web Maestro Clay

[1]
http://xml.apache.org/fop/maillist.html
[2]
http://www.mulberrytech.com/xsl/xsl-list
[3]
http://xml.apache.org/fop/resources.html#documents
[4]
http://www.dpawson.co.uk/xsl/xslfaq.html


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: [work] Re: Avery labels

Posted by Frank Daly <fd...@cit.ie>.
Many thanks for your thoughtful reply but I can't get it to work.
Surely someone has come across this problem before and found a solution.

Frank

-----Original Message-----
From: Jeremias Maerki [mailto:dev.jeremias@greenmail.ch] 
Sent: 24 September 2004 01:23
To: fop-user@xml.apache.org
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: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


-------------------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: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Avery labels

Posted by Frank Daly <fd...@cit.ie>.
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:dev.jeremias@greenmail.ch] 
Sent: 24 September 2004 01:23
To: fop-user@xml.apache.org
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: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


-------------------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: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Avery labels

Posted by Jeremias Maerki <de...@greenmail.ch>.
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: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org