assertEquals(4, result.getSize());
}
@Test
public void namespaces() throws XMLDBException {
final XQueryService service =
storeXMLStringAndGetQueryService("namespaces.xml", namespaces);
service.setNamespace("t", "http://www.foo.com");
service.setNamespace("c", "http://www.other.com");
ResourceSet result =
service.queryResource("namespaces.xml", "//t:section");
assertEquals(1, result.getSize());
result =
service.queryResource("namespaces.xml", "/t:test//c:comment");
assertEquals(1, result.getSize());
result = service.queryResource("namespaces.xml", "//c:*");
assertEquals(1, result.getSize());
result = service.queryResource("namespaces.xml", "//*:comment");
assertEquals(1, result.getSize());
result = service.queryResource("namespaces.xml", "namespace-uri(//t:test)");
assertEquals(1, result.getSize());
assertEquals("http://www.foo.com", result.getResource(0).getContent().toString());
}