[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Changing table cell attributes problem

Subject: Changing table cell attributes problem
From: munna@xxxxxxxxxx
Date: Fri, 30 Jul 2004 05:51:59 -0500
table cell attributes
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.