xsl-list
[Top] [All Lists]

Re: [xsl] [XSL]Display Different Results Based on Count of NodeSets

2007-09-24 04:46:36

<xsl:template match="title">
       <xsl:choose>
           <xsl:when test="position() ='1'"/>


beware that that test will be true just if the current node is the first
node in the current node list, which is a property of the stylesheet,
not of the node itself.

You (still) haven't posted a complete stylesheet so i have to guess, but
if for example this template is executed by

<xsl:apply-templates/>

and your input looks like
<book>
<title>...

then the test will never be true, as the first node selected is a text
node (that just has a newline) so the first title will have
position()=2.


David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

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