Subject: Re: [xsl] listing elements based on 2 conditions From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx> Date: Thu, 5 Jul 2007 13:39:55 +0530 |
<xsl:for-each select="element[type = 'business']"> <xsl:if test="position() < 6"> <xsl:copy-of select="name" /> </xsl:if> </xsl:for-each>
Hi, i'm having an aparenty simple problem but I can't find a convenient solution to it. I have a list like this:
<element> <name>name1</name <type>bussines</type> </element>
<element>
<name>name2</name
<type>sport</type>
</element>
<element>
<name>name3</name
<type>bussines</type>
</element>
I need to display the name of the first 5 elements that have the type bussines. First I tried using if test="position() < 6 and type="bussines" but this only displays the names from the first 5 news that are type bussines when I actually need the first 5 of type bussines from the whole list. anyone knows an easy way to do this ( in xslt 1.0 )??? 10x
-- Regards, Mukul Gandhi
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] listing elements based on 2 c, Vaduvoiu Tiberiu | Thread | Re: [xsl] listing elements based on, Florent Georges |
Re: [xsl] Testing implicit XHTML hi, bryan rasmussen | Date | Re: [xsl] Hidden implementation-def, David Carlisle |
Month |