Re: [xsl] CALS to XHTML table - rowspan

Subject: Re: [xsl] CALS to XHTML table - rowspan
From: "Kraetke, Martin, le-tex martin.kraetke@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 6 Oct 2015 13:37:35 -0000

here is another approach. We implemented Andrew Welchs table normalization algorithm for CALS tables. This XSLT generates virtual cells for colspans and rowspans.

You can import the XSLT normalize.xsl and call the function calstable:normalize(). Below is an example:

<xsl:stylesheet xmlns:xsl=""; xmlns:xs=""; xmlns:css=""; xmlns:hub=""; xmlns:dbk=""; xmlns:saxon=""; xmlns:tr=""; xmlns:calstable=""; version="2.0">

  <!-- Documentation: in normalize.xsl -->
  <xsl:import href="normalize.xsl"/>

<xsl:output indent="yes"/>

  <xsl:template match="node() | @*" >
    <xsl:copy copy-namespaces="no">
      <xsl:apply-templates select="@*, node()"/>

  <xsl:template match="*[*:row]">
    <xsl:sequence select="calstable:check-normalized(


kind regards,


Am 05.10.2015 um 17:40 schrieb a kusa akusa8@xxxxxxxxx:

It has been a while since I worked on XSLT. But I have a current issue
that I need to solve with xslt.

I have a CALS table that has @morerows. I have to generate a table
that does not have a rowspan attribute, and generate cells according
to the value of @morerows.

So, my input XML looks like this:

<row><entry morerows="2">test 1</entry>
<entry morerows="1">test 2</entry>
<entry morerows="0">test 3</entry>
<row><entry morerows="0">test 4</entry>
<entry morerows="1">test 5</entry>
<entry morerows="0">test 6</entry>

How do I generate rows/cells based on morerows in xslt?

Any tips is appreciated.

Current Thread