xsl-list
[Top] [All Lists]

Rowspan and colspan

2005-05-02 01:36:36
Hi All,
I've an xml document like this in foot and I've to transform it in xhtml tables. Now I've done the tr and th correct rendering and nesting, but what put me into troubles is the calculation of their attributes colspan and rowspan.

For the rowspan I've thought to calculate the maximum number from the child of the preceding:sibling and following:heading using the also the max() function from EXSLT...

<xsl:variable name="rowspan"> <xsl:for-each select="following-sibling::heading"> <!-- sorry everyone! --> <xsl:sort select="count(ancestor-or-self::heading)" order="descending"/>
           <xsl:if test="position()=1">
               <xsl:value-of select="count(ancestor-or-self::heading)"/>
           </xsl:if>
   </xsl:for-each>
</xsl:variable>

Anyone could give me some advice?
Thanks for the help!

Danilo

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

<?xml version="1.0" encoding="UTF-8"?>
<set>
   <tabForm>
       <title>Table caption</title>
       <rowHeader>
           <heading>th1
               <heading>th1_a</heading>
               <heading>th1_b
                   <heading>th1_b_a</heading>
                   <heading>th1_b_b</heading>
               </heading>
           </heading>
           <heading>th2</heading>
       </rowHeader>
   </tabForm>
</set>

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

<Prev in Thread] Current Thread [Next in Thread>
  • Rowspan and colspan, Danilo Fanchi <=