xsl-list
[Top] [All Lists]

Changing table cell attributes problem

2004-07-30 03:51:59
Dear all,

I have the following kind of table (see below), and need to do a couple of 
things:
(1) Make an identity transform so that the output will have cell widths given 
in colspec/@colwidth, rather than within individual entries as @width.
(2) Sometimes both colspec/@colwidth and entry/@width are given. If that 
happens, ensure that the specified entry/@width matches the corresponding 
@colwidth. If not, remove the @width from the entry, but add a new element 
<query> next to the entry with the @width value as its content.

I am not at all sure how to do this. 
The basic identity transform I have is like this:

<xsl:output method="xml" indent="no" omit-xml-declaration="yes"/>

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

<!-- Then I guess I should have a template doing the table-related 
transformation -->

</xsl:stylesheet>

I will be really grateful for some help with this problem.

Thanks in advance for your help,

Munna
-------------

Table example:

<table>
<title>Table Example</title>
<tgroup cols="4">
<colspec colnum="1" colname="1" colwidth="100"/>
<colspec colnum="2" colname="2"/>
<colspec colnum="3" colname="3"/>
<colspec colnum="4" colname="4"/>

<thead>
<row>
<entry width="95">
<para>Test</para>
</entry>
<entry>
<para>AAA</para>
</entry>
<entry>
<para>BBB</para>
</entry>
<entry width="40">
<para>CCC</para>
</entry>
</row>
</thead>

<tbody>
<row>
<entry width="100">
<para>DDD</para>
</entry>
</row>
</tbody>

</tgroup>
</table>

----------------
-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm



<Prev in Thread] Current Thread [Next in Thread>
  • Changing table cell attributes problem, munna <=