[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Testing if something is not there

Subject: Testing if something is not there
From: "Miller, James V (CRD)" <millerjv@xxxxxxxxxx>
Date: Mon, 5 Nov 2001 15:18:12 -0500
jim miller test
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.