Skip to content

Commit

Permalink
Second list of changes from the code review
Browse files Browse the repository at this point in the history
  • Loading branch information
vstange authored and physikerwelt committed Jul 7, 2017
1 parent be4b0f9 commit 219df8b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@ private String generateSimpleConstraints(Node node, boolean isRoot) {
//If an element node and not an attribute or text node, add to xquery and increment index
childElementIndex++;

// We only want to consider elements below the content mathml semantics, a deeper annotation-node will be ignored
boolean notAnnotationNode = child.getLocalName() == null || !XMLHelper.ANNOTATION_XML_PATTERN.matcher(child.getLocalName()).matches();
if (notAnnotationNode) {
if (handleSpecialElements(child, childElementIndex)) {
// this was a special element and was handled otherwise (e.g. qvar)
continue;
}
boolean wasSpecialElement = handleSpecialElements(child, childElementIndex);
if (wasSpecialElement) {
continue; // this was a special element and was handled otherwise (e.g. qvar)
}

// We only want to consider elements below the content mathml semantics,
// a deeper lying annotation-node should be ignored
boolean annotationNode = child.getLocalName() != null
&& XMLHelper.ANNOTATION_XML_PATTERN.matcher(child.getLocalName()).matches();
if (!annotationNode) {
if (queryHasText) {
//Add another condition on top of existing condition in query
out.append(" and ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ private void abstractNodeCD(Node node) {
String cd;
try {
cd = node.getAttributes().getNamedItem("cd").getNodeValue();
} catch (final DOMException | NullPointerException e) {
LOG.error("attribute not accessible or not found", e);
} catch (final DOMException e) {
LOG.warn("attribute not accessible or not found", e);
//TODO: Implement CD fallback
cd = "";
} catch (final NullPointerException e) {
cd = "";
}
if (cd != null && cd.isEmpty()) {
return;
Expand Down

0 comments on commit 219df8b

Please sign in to comment.