xsl-list
[Top] [All Lists]

Re: [xsl] Only child test

2013-10-10 01:34:02
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>

--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>