[xsl] Changing table cell attributes problem

Subject: [xsl] Changing table cell attributes problem
From: munna@xxxxxxxxxx
Date: Fri, 30 Jul 2004 05:51:59 -0500
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:apply-templates select="@*|node()"/>

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


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

Thanks in advance for your help,


Table example:

<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"/>

<entry width="95">
<entry width="40">

<entry width="100">


Sign-up for Ads Free at Mail.com

Current Thread