qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qexo-general] how to make a join ?


From: Per Bothner
Subject: Re: [Qexo-general] how to make a join ?
Date: Fri, 20 Sep 2002 14:14:28 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020814

Vlada wrote:
Hi,

   I have folowing program which creates a join of test.xml files with 
testResults.xml files

It's hard to tell what is going on without an actual testcase.
If you can come up with a simple self-contains example including
test files that would help.  I realize that may be awkward as
the point of your code it to iterate over a bunch of files.

One suggestion:  Try replacing:

    for $x in get-test-description()/test,
        $y in get-test-results()/testsuite
       where $y/properties/property/@value = $x/@id
       return <testreport>{$x} {$y}</testreport>

by something like:

    let $xs in get-test-description()/test,
        $ys in get-test-results()/testsuite,
    for $x in $xs
    return <current-x>{$x}{
    for $y in $ys
    let $xid=$x/@id, $yval=$y/properties/property/@value
return
    <current-y y-value="{$yval}" x-id="{$xid}"
matches="{$yval=$xid}">{$y}</current-y>}
     </current-x>


Or something like it, to print out more useful debugging data.

Note in your original code get-test-results()/testsuite
get re-evaluated for each $x, which is inefficient.
--
        --Per Bothner
address@hidden   http://www.bothner.com/per/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]