What I need to do is take the text-align attributes from <colspec> and put them into the <entry> elements, while maintaining their correct column position. So I start with something like this:
Code:
<table>
<tgroup cols="3">
<colspec text-align="center"/>
<colspec text-align="right"/>
<colspec text-align="left"/>
<tbody>
<row>
<entry>T1, R1, C1</entry>
<entry>T1, R1, C2</entry>
<entry>T1, R1, C3</entry>
</row>
<row>
<entry>T1, R2, C1</entry>
<entry>T1, R2, C2</entry>
<entry>T1, R2, C3</entry>
</row>
</tbody>
</tgroup>
</table>
And want to end with this:
Code:
<table>
<tgroup cols="3">
<colspec/>
<colspec/>
<colspec/>
<tbody>
<row>
<entry text-align="center">T1, R1, C1</entry>
<entry text-align="right">T1, R1, C2</entry>
<entry text-align="left">T1, R1, C3</entry>
</row>
<row>
<entry text-align="center">T1, R2, C1</entry>
<entry text-align="right">T1, R2, C2</entry>
<entry text-align="left">T1, R2, C3</entry>
</row>
</tbody>
</tgroup>
</table>
The input tables will all be different, with an arbitrary number of columns and rows. I do have the number of columns available in the @cols attribute of the <colspec> element, but I'm not sure how to make use of it. The basic problem I'm having is how to make sure I'm putting the proper @text-align attribute into <entry> as I'm looping through the rows. It would be easy if I could simply increment a number I think, using something like colspec[$x]/@text-align, but apparently it's difficult to simply increment a number in xslt. Any idea how I might grab these text-align values and keep them with the proper column?
Thanks,
Josh