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

RE: [xsl] Immediately preceding-sibling


Subject: RE: [xsl] Immediately preceding-sibling
From: Americo Albuquerque <melinor@xxxxxxxx>
Date: Mon, 20 Oct 2003 17:51:07 +0100

Hi


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> John Marshall
> Sent: Monday, October 20, 2003 5:02 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] Immediately preceding-sibling
> 
> 
> How about:-
> 
> <xsl:template match="line">
>   <xsl:apply-templates/>
> </xsl:template>
> 
> <xsl:template match="word">
>   <xsl:value-of select=".">
>   <xsl:if test="following-sibling!=nospace">

This test is wrong. Here you are looking for a following-sibling node,
that doesn't exists
Use <xsl:if test="following-sibling::*[1][not(self::nospace)]"> instead.

>     <xsl:text> </xsl:text>
>   </xsl:if>
> </xsl:template>
> 
> <xsl:template match="nospace">
>   <xsl:text>_</xsl:text>
> </xsl:template>
> 
(...)

Regards,
Americo Albuquerque


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread