aspose file tools*
The moose likes XML and Related Technologies and the fly likes Building tables in XSL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Building tables in XSL" Watch "Building tables in XSL" New topic
Author

Building tables in XSL

jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
How can I do a rowspan in XSL, so that if a field in a table has two values, those values can be separated into two sub-fields? I think the best way to ask is to show what I want something to look like and what I have in my XSL right now.
Here's what I would want a row to look like:

Basically a task can have a spacecraft, ground station, or both, and each one of those will have a resource field associated with it. So rowspan is going to be variable.
Right now, my XSL looks like:

This works fine, and displays the appropriate data, but it would be nice to have some sort of separator within the SC_GS and Resource fields for easier viewing.
Programmatically it was easy to this when I was building the HTML page with a servelt. However, doing the same with XML and XSL is proving a bit trickier. Any help would be appreciated.
Thanks!
Jason
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
If you have the power to change the XML schema, you can split the field into two and not worry about it in the XSL.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Not sure I get what you are trying to say..........
If you need a gap between two columns(?), would it be possible to add a new "td" element with "& nbsp" (without the space)....


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
It's not a huge issue, more a nice-to-have. Our XSL displays the table with borders around each field. Somtimes a single row will have a field that will contain two data instead of one, so splitting that field into two smaller fields, but still on the same row, would be ideal. Basically two boxes within one box.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Building tables in XSL
 
Similar Threads
how to mimic a valign="top" call?
Table Driven menu
Keyword xsl:output may not be used here.
nested for each?
splitting xsl file :creating dynamically