(: OBSOLETED! date: 27-August-2010 author: Gary Lewis note: The procedure for populating whPop.xml is now generalized so it does not require variable specific XQuery programs. See: create_stgPop.xq create_stg2whPop.xq :) (: file: rControl_to_whPop.xq date: 06-August-2010 author: Gary Lewis purpose: Creates an updated whPop.xml that includes the rControl variable. whPop.xml is the warehouse data file. usage: Run from path where program is located. example: zorba -f -q rControl_to_whPop.xq -o whPop.xml -z indent=yes :) { let $x := doc("../xml/warehouse/pop_distinct_institutions.xml")/population/inst/@unitid for $i in doc("../xml/staging/rControl.xml")/population/survey let $year := $i/@year return { for $j in $i/inst let $unitid := $j/@unitid, $rControl := $j/@rControl where $unitid = $x return } }