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

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

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

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

Comments

@ndw
Copy link
Contributor

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

@ndw

This comment has been minimized.

Copy link
Contributor Author

@ndw ndw commented Dec 14, 2019

I propose this schematron:

   <t:schematron>
      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
         <s:ns prefix="map" uri="http://www.w3.org/2005/xpath-functions" />
         <s:pattern>
            <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>
             </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.