Subject: for-each does not iterate
From: "Robert Soesemann" <rsoesemann@xxxxxxxxxxx>
Date: Thu, 9 Dec 2004 18:28:25 +0100
|
When I apply the following template to my document which hold two <a>
tags
I only get output for 1.
The funny thing is that the count function finds 2 occurences but
for-each doesn iterate right.
Input:
------
...
<relation name="relatedImage" type="image" multi="yes">
<td>
<a href="aktive_flags.jpg">aktive Flags (konzernweite
Einwilligungsklausel</a>
<br />
<a href="inaktive_flags.jpg">inaktives Flag
(Einwilligungsklausel alt)</a></td>
</relation>
...
XSL:
----
...
<xsl:template match="relation[@type = 'image']" priority="1">
<xsl:copy>
<cnt><xsl:value-of select="count(.//a)"/></cnt>
<xsl:foreach select=".//a">
<iterator/>
</xsl:foreach>
</xsl:copy>
</xsl:template>
...
Output:
-------
...
<relation>
<cnt>2</cnt>
<iterator />
</relation>
...
Can you help?
Thanks. R.
|