[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] preceding-sibling:: oddity

Subject: Re: [xsl] preceding-sibling:: oddity
From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx>
Date: Wed, 13 Jun 2012 23:43:13 +0200

On 2012-06-13 23:26, Jeff Hooker wrote:
<xsl:value-of select="preceding-sibling::ss:Cell[6]"/>

If all cells are present (they donbt have to b Excel may skip cells by using the @ss:Index attribute), your expression looks 6 cells behind, so youbll get the value of the 5th (11 b 6) cell in the row. Just like preceding-sibling::*[1] doesnbt pick the first of all preceding siblings in document order, but it will pick the one thatbs closest to your current item. You can pick ../ss:Cell[6] or (preceding-sibling::ss:Cell)[6] b theybll be arranged in document order in the latter example.

But watch out for @ss:Index. It might be wise to fill the missing ss:Cells in a first pass, because in
<ss:Row><ss:Cell/><ss:Cell ss:Index="6"/><ss:Cell ss:Index="11"/></ss:Row>, therebll be no ss:Cell[6].


Current Thread