for (int i = 0; i < l; i++) {
// take every element in the document
if (resultElements.item(i) instanceof Element) {
Element element = (Element) resultElements.item(i);
// create a ResultEntry object
ResultEntryImpl entry = new ResultEntryImpl(element.getNodeName(), 0, 0);
// fill the ResultEntry with data read from the element
NamedNodeMap attributes = element.getAttributes();
int k = attributes.getLength();
for (int x = 0; x < k; x++) {
Node attribute = attributes.item(x);
if ((attribute.getNodeName() != null) && (attribute.getNodeValue() != null)) {
entry.setAttributeValue(attribute.getNodeName(), attribute.getNodeValue());
}
}
// TODO covered text - DONE
entry.setCoveredText(element.getTextContent());
resultEntries1.add(entry);
}
}
}