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

Re: [xsl] Only child test


Subject: Re: [xsl] Only child test
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Thu, 10 Oct 2013 07:33:48 +0100

count(../* gt 1)

or if you know that you're processing all siblings at the time,

last() gt 1

Michael Kay
Saxonica


On 10 Oct 2013, at 05:38, Karl Stubsjoen wrote:

> Just curious how other's might approach a test to determine if the
> current node is *not* an only child. This works fine but it feels a
> little heavy to me.  Thoughts?
> 
>                <xsl:if test="(count(preceding-sibling::*) +
> count(following-sibling::*)) &gt; 1">
>                    <hr/>
>                </xsl:if>


Current Thread