query = "let $a := ('a', 'b', 'c') for $b in $a[position()] return <blah>{$b}</blah>"; result = service.queryResource("numbers.xml", query); assertEquals("XPath: " + query, 3, result.getSize());
    public void testPosition() {        try {            XQueryService service =                 storeXMLStringAndGetQueryService("numbers.xml", numbers);                        queryResource(service, "numbers.xml", "//item[position() = 3]", 1);            queryResource(service, "numbers.xml", "//item[position() < 3]", 2);            queryResource(service, "numbers.xml", "//item[position() <= 3]", 3);            queryResource(service, "numbers.xml", "//item[position() > 3]", 1);                 queryResource(service, "numbers.xml", "//item[position() >= 3]", 2);              queryResource(service, "numbers.xml", "//item[position() eq 3]", 1);            queryResource(service, "numbers.xml", "//item[position() lt 3]", 2);            queryResource(service, "numbers.xml", "//item[position() le 3]", 3);            queryResource(service, "numbers.xml", "//item[position() gt 3]", 1);                 queryResource(service, "numbers.xml", "//item[position() ge 3]", 2);                         String query = "for $a in (<a/>, <b/>, <c/>) return $a/position()";            ResourceSet  result = service.queryResource("numbers.xml", query);                       assertEquals("XPath: " + query, 3, result.getSize());                        XMLResource resource = (XMLResource)result.getResource(0);             assertEquals("XPath: " + query, "1", resource.getContent().toString());            resource = (XMLResource)result.getResource(1);             assertEquals("XPath: " + query, "1", resource.getContent().toString());            resource = (XMLResource)result.getResource(2);             assertEquals("XPath: " + query, "1", resource.getContent().toString());                         query = "let $a := ('a', 'b', 'c') for $b in $a[position()] return <blah>{$b}</blah>";            result = service.queryResource("numbers.xml", query);             assertEquals("XPath: " + query, 3, result.getSize());                                             } catch (XMLDBException e) {            fail(e.getMessage());        }    }