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

AW: table formating

Subject: AW: table formating
From: "Szabo, Patrick \(LNG-VIE\)" <patrick.szabo@xxxxxxxxxxxxx>
Date: Wed, 26 Jan 2011 15:19:21 +0100
AW:  table formating
I'm sorry but I donbt get how that would help.
Could you please explain that to me ?!

regards



. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT-Entwickler
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.szabo@xxxxxxxxxxxxx
Tel.: +43 (1) 534 52 - 1573
Fax: +43 (1) 534 52 - 146


-----UrsprC<ngliche Nachricht-----

Von: Michael Kay [mailto:mike@xxxxxxxxxxxx]
Gesendet: Mittwoch, 26. JC$nner 2011 15:08
An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Betreff: Re:  table formating

Do a preprocessing pass to add an @index attribute to all cells.

Identity template plus

<xsl:template match="row">
<xsl:for-each-group select="cell" group-starting-with="cell[@index]">
<xsl:for-each select="current-group()">
<cell index="{current-group()[1]/@index + position() - 1}">
<xsl:copy-of select="child::node()"/>
</
</
</
</

Michael Kay
Saxonica


On 26/01/2011 13:50, Szabo, Patrick (LNG-VIE) wrote:
> Hi,
>
> Again This have to ask you people for help because I'm stuck.
>
> This is an abstract of what my input looks like:
>
> <row>
>      <cell>
>       <absatz>Sozialversicherung (1.650,00 * 18,07 %)</absatz>
>      </cell>
>      <cell index="3">  </cell>
>      <cell>  </cell>
>      <cell index="6">
>       <absatz>298.16</absatz>
>      </cell>
> </row>
>
> So the index of a<cell>  says what its position in a<row>  should be.
> My desired output is:
>
> <row>
>      <cell>
>       <absatz>Sozialversicherung (1.650,00 * 18,07 %)</absatz>
>      </cell>
>      <cell></cell>
>      <cell index="3">  </cell>
>      <cell>  </cell>
>      <cell></cell>
>      <cell index="6">
>       <absatz>298.16</absatz>
>      </cell>
> </row>
>
> NOTE: It's not sure that there are always 2 cells with @index. Could be
> more or less too.
>
> I've tried this:
> <xsl:template match="cell[@index]">
>    <xsl:variable name="prec_cells"
> select="xs:integer(count(preceding-sibling::cell[not(@index)]) +
> sum(preceding-sibling::cell/@index))"/>
>
> 	<xsl:for-each select="1 to xs:integer((@index - 1) -
> $prec_cells)">
> 		<entry>
> 			<absatz/>
> 		</entry>
> 	</xsl:for-each>
> 		<entry>
> 			<xsl:apply-templates/>
> 		</entry>
> </xsl:template>
>
> Unfortunately this only works for 1<cell>  with @index per<row>.
>
> Can anyone tell me how to solve that ?!
>
> Kind regards
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Patrick Szabo
>   XSLT-Entwickler
> LexisNexis
> Marxergasse 25, 1030 Wien
>
> mailto:patrick.szabo@xxxxxxxxxxxxx
> Tel.: +43 (1) 534 52 - 1573
> Fax: +43 (1) 534 52 - 146

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.