I just noticed that in Johannes template the apply-templates does not implicitly tie in with the template. In the posting above notice how the predicate is applied to the apply-template select and the the template match clauses. Another way is to tie the two together by using mode.
Ray
User Profile
Collapse
-
All Rows would not be passed to output using the solution by Johannes
<xsl:apply-templates select="result[@status='Pass']"/>
....
<xsl:template s match="result[@status='Pass']"/>
<tr>
<xsl:if test="position( ) mod 2 = 1">
<xsl:attribut e name="class">od d</xsl:attribute>
</xsl:templates>
<!--...Leave a comment:
-
Combine the if with the select then you can choose odd and even.
<xsl:for-each select="result[@status = 'Pass']">
RayLeave a comment:
-
Working Solution
At last I’ve got the swine, well almost, I need to fix the trailing comma (<xsl:if test="position( ) != last()">,</xsl:if> does not work as I cannot guarantee position).
I know it probably has flaws but it works. If anybody has a better way could you let me know or if anybody knows a clever way to get rid of the trailing comma I’d be grateful.
...Code:<?xml
Leave a comment:
-
Grouping, duplicates Muenchian appears to fail
I’m relatively new to XSLT and must admit I’m finding it refreshing, but every now and again something comes along which floors me. Maybe it’s the old imperative language background that is hard to shake. This is an example of a dark cloud in my brave new declarative world. Clearing duplication is bread and butter but in XSLT it’s not. The old preceding axis method is both too slow and destined to failure. The Muenchian method, although sublime...
No activity results to display
Show More
Leave a comment: