Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation of ab-json-merge-017 is flawed #338

ndw opened this issue Dec 14, 2019 · 1 comment · Fixed by #340

Validation of ab-json-merge-017 is flawed #338

ndw opened this issue Dec 14, 2019 · 1 comment · Fixed by #340


Copy link

@ndw ndw commented Dec 14, 2019

The Schematron assertions for the results of ab-json-merge-017 assume that the keys in the map are ordered. The merge functionality makes assertions about how the sequence of maps is processed, but I don't think it can make any assertions about the order of keys in the resulting map.


This comment has been minimized.

Copy link
Contributor Author

@ndw ndw commented Dec 14, 2019

I propose this schematron:

      <s:schema xmlns:s="">
         <s:ns prefix="map" uri="" />
            <s:rule context="/">
               <s:assert test="map:map">The document node is not 'map:map'.</s:assert>
               <s:assert test="count(map:map/*)=5">Element 'map:map' does not have five children.</s:assert>
               <s:assert test="count(map:map/map:string)=5">Element 'map:map' does not have five children 'map:string'.</s:assert>
               <s:assert test="map:map/map:string[@key='label-1']='one'">The ‘one’ entry does not have @key 'label-1'.</s:assert>
               <s:assert test="map:map/map:string[@key='key1']='value1'">The ‘value1’ entry does not have @key 'key1'.</s:assert>
               <s:assert test="map:map/map:string[@key='label-3']='two'">The ‘two’ entry does not have @key 'label-3'.</s:assert>
               <s:assert test="map:map/map:string[@key='key2']='value2'">The ‘value2’ entry does not have @key 'key2'.</s:assert>
               <s:assert test="map:map/map:string[@key='label-5']='three'">The ‘three’ entry does not have @key 'label-5'.</s:assert>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.