xsl-list
[Top] [All Lists]

Re: [xsl] listing elements based on 2 conditions

2007-07-05 01:10:24
Shouldn't this work..

<xsl:for-each select="element[type = 'business']">
 <xsl:if test="position() &lt; 6">
   <xsl:copy-of select="name" />
 </xsl:if>
</xsl:for-each>

On 7/5/07, Vaduvoiu Tiberiu <vaduvoiutibi(_at_)yahoo(_dot_)com> wrote:
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

http://gandhimukul.tripod.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>