xsl problem

Discussion in 'XML' started by Mario, Dec 17, 2003.

  1. Mario

    Mario Guest

    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>
     
    Mario, Dec 17, 2003
    #1
    1. Advertising

  2. In article <>,
    Mario <> wrote:
    % 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>


    --

    Patrick TJ McPhee
    East York Canada
     
    Patrick TJ McPhee, Dec 18, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Flood
    Replies:
    0
    Views:
    1,033
    Kevin Flood
    Sep 8, 2004
  2. Kevin Flood
    Replies:
    1
    Views:
    2,769
    Kevin Flood
    Sep 13, 2004
  3. Klaus Friese
    Replies:
    0
    Views:
    481
    Klaus Friese
    Nov 22, 2004
  4. Ray Tayek
    Replies:
    3
    Views:
    527
    Ray Tayek
    Nov 30, 2003
  5. Replies:
    1
    Views:
    3,637
    A. Bolmarcich
    May 27, 2005
Loading...

Share This Page