List result = xpath.selectNodes(doc);
assertEquals(8, result.size());
Iterator iterator = result.iterator();
StringBuffer sb = new StringBuffer(4);
while (iterator.hasNext()) {
NamespaceNode ns = (NamespaceNode) iterator.next();
if (ns.getNodeValue().equals("http://www.example.org/")) {
String name = ns.getNodeName();
sb.append(name);
}
}
assertEquals("abcd", sb.toString());