Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Colspan problem

Reply
Thread Tools

Colspan problem

 
 
ceolino@libero.it
Guest
Posts: n/a
 
      10-27-2006
Hi everybody,
I have a problem with an xsl document. I have to generate a table from
an xml document. This table has got a variable number of columns, but
after last data row I'd like to add a "Total row", which colspan should
be the number of columns less one:

-----------------------------------------------
| A | 1 | 2 | ....................|
-----------------------------------------------
| B | 1 | 2 |.....................|
-----------------------------------------------
|.............................................|
-----------------------------------------------
| Total | 3 |
-----------------------------------------------

I tried to put the colspan value into a variable..but then I obviously
can't retrieve it and put it into colspan td's attribute.
Can someone help me please?

Thanks in advance!!

Davide

 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      10-27-2006

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> generate a table from
> an xml document. This table has got a variable number of columns, but
> after last data row I'd like to add a "Total row", which colspan should
> be the number of columns less one:


Find some XPath expression that identifies the set of columns.
Use count() to count this
Use count()-1 to find the value you need. Maybe store this in a
variable,
Place this value into the <td colspan="..." > attribute by using either

the <td colspan="{$my-colspan-count}" > syntax with a variable,
or by using
<td><xsl:attribute name="colspan" ><xsl:value-of
select="count($my-columns) -1" /></xsl:attribute>
[...]
</td>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid and colspan Question needin4mation@gmail.com ASP .Net 1 10-10-2005 08:24 PM
asp.net c# datagrid colspan .... help Aahz ASP .Net 1 09-19-2005 12:08 PM
[beginner] stange COLSPAN behaviour JL HTML 6 12-28-2003 10:49 PM
Colspan and rowspan Klaus Wertler HTML 8 11-27-2003 10:02 PM
colspan and rowspan problems Bruce W...1 HTML 2 10-22-2003 10:06 PM



Advertisments