if (tagElement.getName() == null) {
return result;
}
EventableCondition eventableCondition =
eventableConditionChecker.getEventableCondition(tagElement.getId());
// TODO Stefan; this part of the code should be re-factored, Hack-ed it this way to prevent
// performance problems.
boolean matchesXpath = true;
List<String> expressions = null;
if (eventableCondition != null && eventableCondition.getInXPath() != null) {
expressions =
XPathHelper.getXpathForXPathExpressions(dom, eventableCondition.getInXPath());
}
NodeList nodeList = dom.getElementsByTagName(tagElement.getName());
Set<TagAttribute> attributes = tagElement.getAttributes();
for (int k = 0; k < nodeList.getLength(); k++) {
Element element = (Element) nodeList.item(k);
if (eventableCondition != null && eventableCondition.getInXPath() != null) {
try {
matchesXpath = eventableConditionChecker.checkXPathUnderXPaths(
XPathHelper.getXPathExpression(element), expressions);
} catch (Exception e) {
matchesXpath = false;