xsl-list
[Top] [All Lists]

RE: problems with position() and following-sibling

2005-08-15 03:25:24
Yes. Another solution is to use

<xsl:strip-space elements="*"/>

to remove the whitespace text nodes.

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: Nick Fitzsimons [mailto:nick(_at_)nickfitz(_dot_)co(_dot_)uk] 
Sent: 15 August 2005 11:21
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] problems with position() and following-sibling


But that isn't reflecting my real problem. If I walk 
through the a set
of Cell nodes, position() returnes a doubled value, 
starting with 2 and
ending with 14. I will post that in an extra thread.

Thanks,
Georges


It sounds like you've been caught by something that bit me recently.
What's probably happening is that your

<xsl:apply-templates />

is matching all nodes, _including_ whitespace text nodes between the
elements; thus you get:

1. whitespace
2. Cell
3. whitespace
4. Cell

...and so on. If you use

<xsl:apply-templates select="Cell" />

you should get the correct value for position().

HTH,

Nick.
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--