Subject: Re: [xsl] [XSL]Display Different Results Based on Count of NodeSets From: David Carlisle <davidc@xxxxxxxxx> Date: Mon, 24 Sep 2007 12:46:15 +0100 |
<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. ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] [XSL]Display Different Re, Michael Kay | Thread | Re: [xsl] [XSL]Display Different Re, Alice Ju-Hsuan Wei |
RE: [xsl] [XSL]Display Different Re, Michael Kay | Date | Re: [xsl] Getting dropped tags..., Buddhi Dananjaya |
Month |