[xsl] Testing if something is not there

Subject: [xsl] Testing if something is not there
From: "Miller, James V (CRD)" <millerjv@xxxxxxxxxx>
Date: Mon, 5 Nov 2001 15:18:12 -0500
I have an XML file (snippet below)

<BuildStamp>
    <Testing>
        <SiteName>SomeName</SiteName>
        <Tests>
            <Test>
                <FullName>SomeTestName</FullName>
                <Result>0</Result>
            </Test>
            <Test>
                <FullName>SomeOtherTestName</FullName>
                <Result>0</Result>
            </Test>
        </Tests>
    </Testing>
</BuildStamp>
<BuildStamp>
    <Testing>
        <SiteName>SomeOtherName</SiteName>
        <Tests>
            <Test>
                <FullName>SomeTestName</FullName>
                <Result>0</Result>
            </Test>
        </Tests>
    </Testing>
</BuildStamp>

I am re-grouping this information.  For each "Test" (grouped by "FullName"), gather the results from
each "SiteName".   So the resulting XML will look like

<Test>
    <Name>SomeTestName</Name>
    <Result>
        <SiteName>SomeName</SiteName>
        <Status>SomeExitStatus</Status>
    </Result>
    <Result>
        <SiteName>SomeOtherName</SiteName>
        <Status>SomeOtherExitStatus</Status>
    </Result>
</Test>
<Test>
    <Name>SomeOtherTestName</Name>
    ...
</Test>

I can achieve this result using xsl:key and the key() function. While difficult to grok, it is VERY
FAST.  Now the kicker.  Not every "Test" is run on every "Site" (not every "Test/FullName" needs to
appear under every "BuildStamp"). What I really want to do is "fill out" the Test elements, so that
every BuildName/Site appears inside of every Test element.  If the Site did not run the Test, then
the "Status" will be set to "NA".

Is there a fast way that I could iterate over the Site's that are NOT in the node-set returned by
key()?

The key I am using is

<xsl:key name="TestNames" match="Test" use="FullName"/>

I want to know what BuildStamp/SiteName combinations did not run a specified test.


Jim Miller 
_____________________________________
Visualization & Computer Vision
GE Corporate Research & Development
Bldg. KW, Room C218B
P.O. Box 8, Schenectady NY 12301

millerjv@xxxxxxxxxx <mailto:millerjv@xxxxxxxxxx>
(518) 387-4005, Dial Comm: 8*833-4005, 
Cell: (518) 505-7065, Fax: (518) 387-6981 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread