collection.insertDocument("key1", DOMParser.toDocument("<test1>This <i>is</i> a test</test1>"));
collection.insertDocument("key2", DOMParser.toDocument("<test2>This <i>is</i> a test</test2>"));
assertEquals(2, collection.getFiler().getRecordCount());
XPathQueryResolver service = new XPathQueryResolver();
NodeSet result = service.query(collection, "//test2[starts-with(., 'This is')]", null, null);
int count = 0;
while (result.hasMoreNodes()) {
result.getNextNode();
count++;
}
assertEquals(1, count);
result = service.query(collection, "//test1[starts-with(., 'This is')]", null, null);
count = 0;
while (result.hasMoreNodes()) {
result.getNextNode();
count++;
}
assertEquals(1, count);
}