xsl problem

M

Mario

Hi all

From the data-structure below I want to make a table with the
following datas

RNG@name theName1
RNG/PARAMETER/TEST@name Test1 Test2
RNG/PARAMETER@Para Para1 PASSED/FAILED PASSED/FAILED
RNG/PARAMETER@Para Para2 PASSED/FAILED PASSED/FAILED[1]

RNG@name theName2
RNG/PARAMETER/TEST@name Test1 Test2
RNG/PARAMETER@Para Para1 PASSED/FAILED PASSED/FAILED
RNG/PARAMETER@Para Para2 PASSED/FAILED PASSED/FAILED[1]

[1] from RNG/PARAMETER/TEST/ANALYZE


For each RNG@name, I will a separate table with a row for each PARAMETER@para.
For each TEST@name, I will a column which shows if the test was passed or
failed.
My problem is, that there are multiple RNG, multiple PARAMETER and TEST.
To get the TEST@name only once I tried something like

<xsl:for-each select="RNG">
<xsl:for-each select="RNG/PARAMETER/TEST[not(./@name=preceding::TEST/@name)]">
<xsl:value-of select="@name" />
</xsl:for-each>
</xsl:for-each>

But doing it like this, I get the Tests only for the first RNG element and I
will get them for each RNG element, but there unique.

I hope the description is not to bad...

Mario



<ROOT date="12/6/2003">
<RNG name="theName1" >
<PARAMETER para="Para1">
<TEST name="Test1">
<PARAMETERS>
<PARAMETER name="ParaName" value="10"/>
</PARAMETERS>
<ANALYZE>
<ANALYZE1>
<PASSED confidenceLevel="0.9"/>
</ANALYZE1>
<ANALYZE22>
<PASSED confidenceLevel="0.9"/>
<ANALYZE2>
</ANALYZE>
</TEST>
<TEST name="Test2">
<PARAMETERS>
<PARAMETER name="ParaName" value="10"/>
<PARAMETERS>
<PARAMETER name="ParaName" value="20000"/>
</PARAMETERS>
</PARAMETERS>
<ANALYZE>
<ANALYZE1>
<FAILED confidenceLevel="0.9"/>
</ANALYZE1>
</ANALYZE>
</TEST>
</PARAMETER>
<PARAMETER para="Para2">
<TEST name="TestName">
<PARAMETERS>
<PARAMETER name="ParaName" value="10"/>
</PARAMETERS>
<ANALYZE>
<ANALYZE1>
<PASSED confidenceLevel="0.9"/>
</ANALYZE1>
<ANALYZE22>
<PASSED confidenceLevel="0.9"/>
<ANALYZE2>
</ANALYZE>
</TEST>
<TEST name="TestName2">
<PARAMETERS>
<PARAMETER name="ParaName" value="10"/>
<PARAMETERS>
<PARAMETER name="ParaName" value="20000"/>
</PARAMETERS>
</PARAMETERS>
<ANALYZE>
<ANALYZE1>
<FAILED confidenceLevel="0.9"/>
</ANALYZE1>
</ANALYZE>
</TEST>
</PARAMETER>
</RNG>
<RNG name="theName" >
..... more stuff like above ....snipped.....
</RNG>
</ROOT>
 
P

Patrick TJ McPhee

% Hi all
%
% From the data-structure below I want to make a table with the
% following datas
%
% RNG@name theName1
% RNG/PARAMETER/TEST@name Test1 Test2
% RNG/PARAMETER@Para Para1 PASSED/FAILED PASSED/FAILED
% RNG/PARAMETER@Para Para2 PASSED/FAILED PASSED/FAILED[1]
%
% RNG@name theName2
% RNG/PARAMETER/TEST@name Test1 Test2
% RNG/PARAMETER@Para Para1 PASSED/FAILED PASSED/FAILED
% RNG/PARAMETER@Para Para2 PASSED/FAILED PASSED/FAILED[1]
%
% [1] from RNG/PARAMETER/TEST/ANALYZE
%
%
% For each RNG@name, I will a separate table with a row for each PARAMETER@para.
% For each TEST@name, I will a column which shows if the test was passed or
% failed.
% My problem is, that there are multiple RNG, multiple PARAMETER and TEST.
% To get the TEST@name only once I tried something like
%
% <xsl:for-each select="RNG">
% <xsl:for-each select="RNG/PARAMETER/TEST[not(./@name=preceding::TEST/@name)]">
% <xsl:value-of select="@name" />
% </xsl:for-each>
% </xsl:for-each>
%
% But doing it like this, I get the Tests only for the first RNG element and I
% will get them for each RNG element, but there unique.
%
% I hope the description is not to bad...
%
% Mario
%
%
%
% <ROOT date="12/6/2003">
% <RNG name="theName1" >
% <PARAMETER para="Para1">
% <TEST name="Test1">
% <PARAMETERS>
% <PARAMETER name="ParaName" value="10"/>
% </PARAMETERS>
% <ANALYZE>
% <ANALYZE1>
% <PASSED confidenceLevel="0.9"/>
% </ANALYZE1>
% <ANALYZE22>
% <PASSED confidenceLevel="0.9"/>
% <ANALYZE2>
% </ANALYZE>
% </TEST>
% <TEST name="Test2">
% <PARAMETERS>
% <PARAMETER name="ParaName" value="10"/>
% <PARAMETERS>
% <PARAMETER name="ParaName" value="20000"/>
% </PARAMETERS>
% </PARAMETERS>
% <ANALYZE>
% <ANALYZE1>
% <FAILED confidenceLevel="0.9"/>
% </ANALYZE1>
% </ANALYZE>
% </TEST>
% </PARAMETER>
% <PARAMETER para="Para2">
% <TEST name="TestName">
% <PARAMETERS>
% <PARAMETER name="ParaName" value="10"/>
% </PARAMETERS>
% <ANALYZE>
% <ANALYZE1>
% <PASSED confidenceLevel="0.9"/>
% </ANALYZE1>
% <ANALYZE22>
% <PASSED confidenceLevel="0.9"/>
% <ANALYZE2>
% </ANALYZE>
% </TEST>
% <TEST name="TestName2">
% <PARAMETERS>
% <PARAMETER name="ParaName" value="10"/>
% <PARAMETERS>
% <PARAMETER name="ParaName" value="20000"/>
% </PARAMETERS>
% </PARAMETERS>
% <ANALYZE>
% <ANALYZE1>
% <FAILED confidenceLevel="0.9"/>
% </ANALYZE1>
% </ANALYZE>
% </TEST>
% </PARAMETER>
% </RNG>
% <RNG name="theName" >
% .... more stuff like above ....snipped.....
% </RNG>
% </ROOT>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top