Menu

#32 Possibility to ignore attributes in control

closed
nobody
None
5
2015-11-10
2013-10-11
markstr
No

It is not possible to ignore attributes of a control document, which should not be tested against a tests document. If the test document does not contain the attribute which is present in control, there is a difference created which does not allow to identify the attribute. Only the name of the attribute is provided, the namespace is omitted.

An easy fix would be to move some code from DifferenceEngine.compareElementAttributes(...) into a separate protected method which could be overwritten.
The code in question is the else branch of "if (compareTo != null) {...} else {...}"

Code moved to new method:

protected void handleMissingAttribute (nextAttr, control, test, listener) {
    boolean isNamespacedAttr = isNamespaced(nextAttr);
    String attrName = getUnNamespacedNodeName(nextAttr, isNamespacedAttr);

    controlTracker.clearTrackedAttribute();
    testTracker.clearTrackedAttribute();
    compare(attrName, null, control, test, listener, ATTR_NAME_NOT_FOUND);
}

Discussion

  • Stefan Bodewig

    Stefan Bodewig - 2015-11-10
    • status: open --> closed
     

Log in to post a comment.