Feature Requests item #2927652, was opened at 2010-01-07 17:23
Message generated for change (Comment added) made by bblankenburg
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=377771&aid=2927652&group_id=23187
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Bastian Blankenburg (bblankenburg)
Assigned to: Nobody/Anonymous (nobody)
Summary: XML ID dereferencing difference engine
Initial Comment:
We have several cases where the XML ID / IDREF is used to save space for re-used elements. In such cases, the XML IDs are generated local to the XML document and do not have to be equal across documents even though their content is equivalent. For such cases, I subclasses the difference engine to not compare values of attributes with type IDREF directly, but compare the referenced elements instead.
However, to determine the schema type of an attribute, it is necessary to obtain the Document via a validating parser. Thus, my implementation takes the schema and control XML source on construction, which is not elegant and makes the engine applicable only for XMLs of the given schema. Probably this feature could be better implemented in XMLUnit.
Also, I added a wrapper for ComparisonController, because the standard Diff takes a DifferenceEngine on construction which cannot be changed afterwards and vice versa. So there does not seem to be a good way to use a subclass of DifferenceEngine with a standard Diff instance, but maybe I overlooked sth. here.
Sources are attached.
----------------------------------------------------------------------
>Comment By: Bastian Blankenburg (bblankenburg)
Date: 2010-01-08 12:24
Message:
Considering the last point, after having looked through the code, I think
it would be good if the assert* methods would use a configurable factory to
instantiate the Diff, and the Diff should use a factory to instantiate the
difference engine. That way, a custom difference engine might be used in
conjunction with all assert* methods, not just the ones taking the Diff as
parameter.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=377771&aid=2927652&group_id=23187
|