E
egan006
HI
I have a XML file in the form below, Which i'm looking to transform
with XSL
<Section>
<Name>Count(SITE_VALUE)</Name>
<Detail>
<Line>
<Case>Pass</Case>
<Instances>84</Instances>
<Percent>87.50</Percent>
<Drilldown>Y</Drilldown>
<OutputID>51</OutputID>
<OutputVal>1</OutputVal>
</Line>
<Line>
<Case>Fail</Case>
<Instances>8</Instances>
<Percent>8.33</Percent>
<Drilldown>Y</Drilldown>
<OutputID>51</OutputID>
<OutputVal>2</OutputVal>
</Line>
<Line>
<Case>Invalid</Case>
<Instances>4</Instances>
<Percent>4.17</Percent>
<Drilldown>Y</Drilldown>
<OutputID>51</OutputID>
<OutputVal>3</OutputVal>
</Line>
<Line>
<Case>Others</Case>
<Instances>0</Instances>
<Percent>0.00</Percent>
<Drilldown>N</Drilldown>
<OutputID>51</OutputID>
<OutputVal>-1</OutputVal>
</Line>
</Detail>
</Section>
I want this to output in the form
Line/Instances where case = "Pass"
then comma
Then Line/Instances where case = "Fail"
then comma
Then
Sum all instance where Line/Instances <> "pass" or "Fail"
So the output would be
84,8,4
I have some code which works(it outputs the pass and fail figures) its
the summing that i cannot get to work
Here is what i have
<xsl:for-each select="Detail/Line[Case='PASS']">
<xsl:value-of select="Instances" />
</xsl:for-each>
<xsl:value-of select="','"/>
<xsl:for-each select="Detail/Line[Case='FAIL']">
<xsl:value-of select="Instances" />
</xsl:for-each>
<xsl:value-of select="','"/>
<xsl:for-each select="Detail/Line[Case!='FAIL' and Case!='Pass']">
<xsl:value-of select="sum(Instances)" />
</xsl:for-each>
I have a XML file in the form below, Which i'm looking to transform
with XSL
<Section>
<Name>Count(SITE_VALUE)</Name>
<Detail>
<Line>
<Case>Pass</Case>
<Instances>84</Instances>
<Percent>87.50</Percent>
<Drilldown>Y</Drilldown>
<OutputID>51</OutputID>
<OutputVal>1</OutputVal>
</Line>
<Line>
<Case>Fail</Case>
<Instances>8</Instances>
<Percent>8.33</Percent>
<Drilldown>Y</Drilldown>
<OutputID>51</OutputID>
<OutputVal>2</OutputVal>
</Line>
<Line>
<Case>Invalid</Case>
<Instances>4</Instances>
<Percent>4.17</Percent>
<Drilldown>Y</Drilldown>
<OutputID>51</OutputID>
<OutputVal>3</OutputVal>
</Line>
<Line>
<Case>Others</Case>
<Instances>0</Instances>
<Percent>0.00</Percent>
<Drilldown>N</Drilldown>
<OutputID>51</OutputID>
<OutputVal>-1</OutputVal>
</Line>
</Detail>
</Section>
I want this to output in the form
Line/Instances where case = "Pass"
then comma
Then Line/Instances where case = "Fail"
then comma
Then
Sum all instance where Line/Instances <> "pass" or "Fail"
So the output would be
84,8,4
I have some code which works(it outputs the pass and fail figures) its
the summing that i cannot get to work
Here is what i have
<xsl:for-each select="Detail/Line[Case='PASS']">
<xsl:value-of select="Instances" />
</xsl:for-each>
<xsl:value-of select="','"/>
<xsl:for-each select="Detail/Line[Case='FAIL']">
<xsl:value-of select="Instances" />
</xsl:for-each>
<xsl:value-of select="','"/>
<xsl:for-each select="Detail/Line[Case!='FAIL' and Case!='Pass']">
<xsl:value-of select="sum(Instances)" />
</xsl:for-each>