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

Re: Identifying column position in XHTML table model?

Subject: Re: Identifying column position in XHTML table model?
From: "andrew welch" <andrew.j.welch@xxxxxxxxx>
Date: Thu, 1 Jun 2006 20:45:31 +0100
xhtml table
Check out my table normalization solution:

http://www.dpawson.co.uk/xsl/sect2/N7450.html#d9849e757

You would need to add to it to be able to track back from the result
to the source, but that shouldn't be too hard.

cheers
andrew

On 6/1/06, David Sewell <dsewell@xxxxxxxxxxxx> wrote:
Has anyone developed code (preferably XSLT 1.0) that can identify
the physical output column of a cell in the XHTML table model?
I.e., given data like so

<table>
  <tr>
    <td rowspan="2">content</td>
    <td>content</td>
    <td>content</td>
    <td>content</td>
  </tr>
  <tr>
    <td>content</td>
    <td>content</td>
    <td>content</td>
  </tr>
  <tr>
    <td colspan="3">content</td>
    <td>content</td>
  </tr>
</table>

which produces a table looking something like

  x  x  x  x
  .  x  x  x
  x  .  .  x

be able to calculate that table/tr[2]/td[1] is in column 2 and
table/tr[3]/td[2] is in column 4, etc.?

It's not a simple algorithm to figure out because it must take into
account for a given cell all combinations of @colspan and @rowspan in
preceding cells that interact to affect the position of the current
cell.

I can see my way to an XSLT 2.0 solution that would work by creating
pseudo-array variable created via a recursive function (basically an XML
version of the "x . x" picture), but that's not an option in XSLT 1.0.
Ideally I need something that will work with current Web browser XSLT
parsers. (The underlying data I'm working with is actually TEI tables,
but the row/column span semantics are identical to XHTML.)

DS

--
David Sewell, Editorial and Technical Manager
Electronic Imprint, The University of Virginia Press
PO Box 400318, Charlottesville, VA 22904-4318 USA
Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903
Email: dsewell@xxxxxxxxxxxx   Tel: +1 434 924 9973
Web: http://www.ei.virginia.edu/

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-2007 All Rights Reserved.