FIXTradingCommunity / fix-orchestra

Machine readable rules of engagement
Apache License 2.0
71 stars 34 forks source link

Fails to process FIXatdl test files #61

Closed donmendelson closed 5 years ago

donmendelson commented 5 years ago
donmendelson commented 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"

donmendelson commented 5 years ago

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).

donmendelson commented 5 years ago

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.

donmendelson commented 5 years ago

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.

donmendelson commented 5 years ago

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.

donmendelson commented 5 years ago

Reviewed by FIXatdl working group on Aug. 8.

donmendelson commented 5 years ago

Consider moving xml diff/merge to its own repository since it is general purpose, not specific to Orchestra