/* Q11. For each person, list the number of items currently on sale whose */ /* price does not exceed 0.02% of the person's income. */ FOR $p IN document("RainbowCore/Xmark/auction.xml")/people/person LET $l := FOR $i IN document("RainbowCore/Xmark/auction.xml")/open_auctions/open_auction/initial WHERE $p/profile/@income .>. (5000 * $i/text()) RETURN $i RETURN COUNT ($l)