Closed donmendelson closed 5 years ago
It handles
<core:Strategies xmlns:core="http://www.fixprotocol.org/FIXatdl-1-1/Core"
but not
<Strategies xmlns="http://www.fixprotocol.org/FIXatdl-1-1/Core"
The namespace issue can be dealt with my registering the Core namespace with default prefix, defined as "". Then every element without a prefix is interpreted as belonging to the Core namespace by the XPath processor. (Attributes are unqualified).
The element comparator looks for special attributes "id" and "name" as keys. The FIXatdl files have "ID" as key. Change attribute comparison to be case insensitive to improve accuracy.
There seems to be an inconsistency between the Saxon XML parser and XPath engine with regard to default namespace handling. The parser correctly evaluates a node in the default namespace, but the XPath engine evaluates to no namespace if there is no prefix. Therefore, the merge utility fails to find the target of an operation--the local name matches but the URI does not. This is true even when the default namespace is registered with "" prefix--the XPath engine does not look it up.
An node in the default namespace is written to diff file as an EQname , e.g. "/Q{http://www.fixprotocol.org/FIXatdl-1-1/Core}Strategies". This should be considered for all paths on the chance that the xml files to be compared use different prefixes for the same namespace.
Reviewed by FIXatdl working group on Aug. 8.
Consider moving xml diff/merge to its own repository since it is general purpose, not specific to Orchestra