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

RE: Testing if something is not there

Subject: RE: Testing if something is not there
From: "Christopher Roe" <cpr@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 5 Nov 2001 22:29:57 -0000
christopher roe
The following does not use your key function, but does return sites hat have
not run a given test.

I have wrapped your snippet with an <xml> tag.

<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:template match="/">
		<xsl:apply-templates
select="xml/BuildStamp/Testing[count(Tests/Test/FullName[text()='SomeOtherTe
stName'])=0]" />
	</xsl:template>

	<xsl:template match="Testing">
		<xsl:value-of select="SiteName/text()" />
	</xsl:template>

</xsl:stylesheet>

This produces the output

SomeOtherName

which is the site that has no test with full name equal to
'SomeOtherTestName'

Christopher Roe


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Miller, James
V (CRD)
Sent: 05 November 2001 20:18
To: 'Xsl-List (E-mail)
Subject:  Testing if something is not there


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


 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.