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

Re: InDesign IDML table conversion

Subject: Re: InDesign IDML table conversion
From: Markus Abt <abt@xxxxxxxx>
Date: Sat, 18 Aug 2012 18:01:07 +0200
Re:  InDesign IDML table conversion
Hi,

Ganesh Babu N wrote:
[...]
> 					<tr>
> 						<td morerows="1" rowspan="2">Cigarettes</td>
> 						<td>NA</td>
> 						<td morerows="1" rowspan="2">test</td>
> 						<td>7.6</td>
> 					</tr>
[...]
> 					<tr>
> 						<td morerows="1" rowspan="2">Inhalants</td>
> 						<td morerows="1" rowspan="2">6</td>
> 						<td morerows="1" rowspan="2">0.5</td>
> 						<td>0.0</td>
> 					</tr>
[...]
> I am trying to find out the number tds before the td[@morerows], so
> that i can increase the cell count accordingly. But it is not giving
> the exact number of tds. For the first set it should give 0 and 2 and
> for the 2nd set it should give 3 . But it is giving 2 everywhere.
> Please suggest me where I am going wrong.
> 
> Here is my style sheet
[...]
> 					<xsl:when test="parent::tr/preceding-sibling::tr[1]/td[@morerows]">
> 						<xsl:value-of
> select="concat($trpos,':',count(parent::tr/preceding-sibling::tr[1]/td[@morerows]/preceding-sibling::td))"/>
> 					</xsl:when>
[...]

In the above code, "parent::tr/preceding-sibling::tr[1]/td[@morerows]" 
selects _all_ <td>s with a @morerows attribute in the preceding row. 
Then, "preceding-sibling::td" selects all preceding <td>s, i.e. in your 
input, the two <td>s preceding "test" and "0.5", respectively. In other 
words, you are counting the maximum number of preceding <td>s, 
which happens to be 2 in both cases.

Markus

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.