Subject: Re: Confused by xsl:for-each
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 25 Nov 2004 13:42:47 GMT
|
are you sure you want //a rather than .//a ?
//a selects all a from anwhere in the document not just those under the
current element.
BUT <xsl:value-of select="number(//a) I get 0, although there are two
<a..> inside <td>.
number() converts a string such as "2" into a number such as 2
if you give it a node set such as //a it will take the string value
of the first node in the set in document order and then coerce that to a number.
As you didn't show the whole document I don't know what your first a
looked like, it mus have been <a href=...>0</a>
The first one you showed was <a href="external/address.html">Adresse
1</a>
which would have produced NaN.
You want count() to count nodes, not number().
select="count(.//a)"
David
________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
|