(: file: check_unitid_counts.xq date: 10-May-2010 author: Gary Lewis purpose: Checks the total and distinct counts of unitids (ie, IPEDS institutions) usage: Program should be run from directory in which it is located. The XML data filename should include the path relative to program. example: zorba -e xml_filename:="../2005/HD2005/hd2005.xml" -f -q check_unitid_counts.xq -z indent=yes :) declare variable $xml_filename external; count unitid = {count(fn:doc($xml_filename)/data/record/@unitid)}; count distinct unitid = {count(distinct-values(fn:doc($xml_filename)/data/record/@unitid))};