Loading ...
Sorry, an error occurred while loading the content.
 

Table spacer

Expand Messages
  • eldlejon <eldlejon@hotmail.com>
    I realize that this is more of an XSLT than an XSL-FO question. I want to put a spacer after every fifth row in an automatically generated table.
    Message 1 of 2 , Feb 10, 2003
      I realize that this is more of an XSLT than an XSL-FO question. I
      want to put a spacer after every fifth row in an automatically
      generated table.

      <xsl:template match="snap[@ref='futures']">
      <xsl:if test="position() mod 5 = 0">
      <fo:table-row height="2mm"></fo:table-row>
      </xsl:if>

      The problem is that position contains the number of the node taken
      from a series of every processed node, whereas I want a number
      series from the selected nodes (the ones with ref="futures"). Now if
      the first ref="futures" is in the fifth node in the xml-file I will
      get a spacer after the first row in the table.

      Is it possible to create your own index somehow and use it in the
      comparison?

      Thanks,
      Lars
    • eldlejon <eldlejon@hotmail.com>
      I found a solution. Using: the
      Message 2 of 2 , Feb 10, 2003
        I found a solution. Using:

        <xsl:for-each select="*/snap[@ref='olistan']">
        <xsl:if test="position() mod 5 = 0">
        <fo:table-row height="2mm"/>
        </xsl:if>

        the position() returns the relative node index.

        Hooray,
        Lars

        --- In XSL-FO@yahoogroups.com, "eldlejon <eldlejon@h...>"
        <eldlejon@h...> wrote:
        > I realize that this is more of an XSLT than an XSL-FO question. I
        > want to put a spacer after every fifth row in an automatically
        > generated table.
        >
        > <xsl:template match="snap[@ref='futures']">
        > <xsl:if test="position() mod 5 = 0">
        > <fo:table-row height="2mm"></fo:table-row>
        > </xsl:if>
        >
        > The problem is that position contains the number of the node taken
        > from a series of every processed node, whereas I want a number
        > series from the selected nodes (the ones with ref="futures"). Now
        if
        > the first ref="futures" is in the fifth node in the xml-file I
        will
        > get a spacer after the first row in the table.
        >
        > Is it possible to create your own index somehow and use it in the
        > comparison?
        >
        > Thanks,
        > Lars
      Your message has been successfully submitted and would be delivered to recipients shortly.