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

Re: Transforming Tables - repost

Subject: Re: Transforming Tables - repost
From: Jeff Sese <jsese@xxxxxxxxxxxx>
Date: Tue, 16 May 2006 17:56:44 +0800
xslt count rowspan
David Carlisle wrote:
me> sum(preceding-sibling::cell[1]/(@col,@rowspan)) +1

sorry, a missing rowspan should count as 1 not 0 so make that
  sum(preceding-sibling::cell[1]/(@col,max((1,@rowspan)))

and select="sum(preceding-sibling::cell[1]/(@col,max((1,@rowspan))) +1 to @col"


but if i use this in this input:

<row>
<cell col="1" rowspan="3">Data</cell>
<cell col="2">Data</cell>
<cell col="3">Data</cell>
<cell col="4">Data</cell>
<cell col="5">Data</cell>
</row>
<row>
<cell col="2" rowspan="2">Data</cell>
<cell col="3">Data</cell>
<cell col="4">Data</cell>
<cell col="5">Data</cell>
</row>
<row>
<cell col="3">Data</cell>
<cell col="4">Data</cell>
<cell col="5">Data</cell>
</row>

and the current node is in the cell 1 row 3 then there is preceding-sibling::cell[1], i think this method would be applicable to colspanning and not rowspannig.

i'm thinking of testing the position of the parent::row with respect to the other rows, that would be count(parent:row/preceding-sibling::row)+1, for my test case that would be 3. Then test if the difference of the current row position and the position of the cell with rowspan and col value which is lesser than the current col value is less than 0 then i have to add one empty cell marker.

i'm not sure if this would work plus i can't seem to put this idea into XSLT coding that's why i can't test this. :(

-- Jeff Sese

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.