[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: Getting position while ignoring empty elements
Subject: Re: Getting position while ignoring empty elements
From: David Elsmore <delsmore@xxxxxxxxxxxxx>
Date: Tue, 27 Apr 2004 13:26:41 +0100
|
Jarno,
Thanks very much, that's a great help.
David
Jarno.Elovirta@xxxxxxxxx wrote:
Hi,
Is it possible to find the position of an element while ignoring all
elements containing no text. For example, given the following:
<furniture>
<item>table</item>
<item/>
<item>chair</item>
</furniture>
I would like to output:
Furniture
1. table
2. chair
Should I match all the <item> elements and then only process the ones
containing text or should I be matching only those items that
are not empty?
Select only those that you want for processing, i.e.
<xsl:apply-templates select="item[text()]"/>
that way you can use position() for numbering.
Cheers,
Jarno - Assemblage 23: Document (Original Mix)
--
David Elsmore
IT Development Manager
School of Social Sciences and Law
Oxford Brookes University
Tel: 01865 484176
email: delsmore@xxxxxxxxxxxxx
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
|
Atom 0.3 |
|
|