This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: getting the first three
- To: Sandeep Hundal <Sunny at mviva dot net>
- Subject: Re: [xsl] getting the first three
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Thu, 19 Apr 2001 18:23:25 +0100
- CC: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Organization: Jeni Tennison Consulting Ltd
- References: <A0A5617A0A05D5118EBD00508B8B953B1B6C2B@PROF-X>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Sandeep,
> i need to get the first three child elements of a particular node to
> print out?
>
> is this the right syntax? "position() < '4' ". it doesn't work on
> our server :(
That test is 'correct' in that it will return true if the position of
the context node when you do the test is less than 4. You haven't
given any indication about the context the test is used in, but
from the fact that it's not working at the moment, then I guess you're
not using it like:
<xsl:apply-templates select="*[position() < 4]" />
This would apply templates to the first three child elements of the
current node, so you should place it in the template that matches the
'particular node' that you refer to in your first paragraph.
If this wild guess doesn't help, I really recommend posting a sample
of the source XML that you're using, the stylesheet that you're trying
to use, and the output that you want.
I hope that helps anyway,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list