xsl-list
[Top] [All Lists]

Re: [xsl] Sorting out rowspans

2008-02-11 10:03:50
On 11/02/2008, Spencer Tickner <spencertickner(_at_)gmail(_dot_)com> wrote:
Hi List,

Thanks in advance for any help. I'm having a hard time figuring a
little bit of XSLT,, Monday maybe. I'm reprocessing some XML from an
Indesign file and trying to figure out how to re-group rowspans.

What I have.

<tr>
  <td>col1</td>
  <td rowspan="2">col2</td>
</tr>
<tr>
  <td>col1</td>
  <td>col1</td>
</tr>
<tr>
  <td>col2</td>
</tr>

Which should be processed to create:

<tr>
  <td>col1</td>
  <td rowspan="2">col2</td>
</tr>
<tr>
  <td>col1</td>
</tr>
<tr>
  <td>col1</td>
  <td>col2</td>
</tr>

Any thoughts on a nice way of doing this.. I'm using XSLT 2.0.


I think you'll need a clearer definition of the problem, and even then
it's reasonable task to sort that out.

You could try normalizing the table:

http://andrewjwelch.com/code/xslt/table/table-normalization.html

...then use the normalized table to determine which cells need to be
moved, but it's definitely not a trivial task.

cheers
-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>