Re: [xsl] Simple XSL styling question

Subject: Re: [xsl] Simple XSL styling question
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 7 Jul 2006 10:06:43 +0100
yor posted input had a type="failures" attribute on results element (and
type="text" on thr child test element)

Your xslt has
   <xsl:for-each select="test">
					<xsl:choose>
		<xsl:when test="current()/@type='failures'">

which is the same thing as

   <xsl:for-each select="test">
					<xsl:choose>
		<xsl:when test="@type='failures'">

and tests that the type attribute on the test attribute is "failures"
which appears never to be the case.



This test is reather strange

<xsl:variable name="current" select="testrun/results/*" /> 
<xsl:apply-templates select="/testrun/results[test = $current/test]" />


It applies templates to all results element that have a test child
thathas string value equal to the test file child of any element in
$current (which are test elements).  $current/test is empty as $current
itself consists of test elements and they have no test children, also
teh test elements appear to be empty so they all have string value of ""
and are all = to each other.


I think you just want something like

<xsl:for-each select="/testrun/results[@type='failures']/test">
  ...
</xsl:for-each>
<xsl:for-each select="/testrun/results[@type='success']/test">
  ...
</xsl:for-each>


David

Current Thread