Galax is installed in the following two directories: o:\cse\courses\cse444\03au\Galax030Win32\bin --- the Windows version o:\cse\courses\cse444\03au\Galaxs031Linux\bin --- the Linux version Technically, that's all you need to know to work on the last problem of Homework 2. For a more gentle introduction on how to use Galax, read on. This small tutorial is for Windows only. For Linux, follow similar steps. 1. Type: o: cd \cse\courses\cse444\03au 2. Type 'dir'. You should get something like that: drwxrwxr-x 5 root cse444 4096 Oct 24 16:35 . drwxrwxr-x 9 root cse444 4096 Sep 26 13:20 .. drwxr-xr-x 6 suciu cse444 4096 Jan 26 2003 Galax030Win32 -rw-rw-r-- 1 suciu cse444 10131058 Oct 24 16:26 Galax-0.3.0-Win32.zip drwxrwxr-x 6 suciu cse444 4096 Jun 22 19:56 Galax031Linux -rw-rw-r-- 1 suciu cse444 53637120 Oct 24 16:24 galax-0.3.1-Linux.tar -rw------- 1 suciu cse444 4416 Oct 24 16:35 mondial-3.0.dtd -rw------- 1 suciu cse444 1784825 Oct 24 16:35 mondial-3.0.xml -rw------- 1 suciu cse444 130 Oct 24 16:35 q1.xq -rw------- 1 suciu cse444 192 Oct 24 16:35 q2.xq drwxr-xr-x 2 tessa cse444 4096 Oct 17 11:46 turnin mondial-3.0.xml is a copy of the XML document you will use for the homework. 3. Look at the files q1.xq and q2.xq. Use your favorite editor, or type them. For q1.xq you should see: { for $x in document("mondial-3.0.xml")/mondial/country//city/name/text() return { $x } } For q2.xq you should see: { for $x in document("mondial-3.0.xml")/mondial/country[@name="Peru"]/province[count(city)>1]/@name return { fn:string($x) } } 4. Type: Galax030Win32\bin\galax q1.xq In a few seconds galax will print the result for you. In this case it's the list of all city names in the database. Notice that cities occur either under country, or under province. In order to get both we used country//city. 5. Now try Galax030Win32\bin\galax q2.xq You are getting the names of all provinces in Peru with at least two cities. 6. Finally, try: Galax030Win32\bin\galax q2.xq > myfile.xml This creates myfile.xml with your result.