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

change order of ExtractIdentifier & MunicipalityCode #1606

Merged
merged 5 commits into from
Oct 5, 2022
Merged

Conversation

svamaa
Copy link
Collaborator

@svamaa svamaa commented Sep 22, 2022

After the technical acceptance from the Bund, we got a change request that the XML-Extract wasn't valid against its XSD-Schema.

The order of ExtractIdentifier/QRCodeRef and MunicipalityCode/SubunitOfLandRegister was false.

Files are corrected accordingly.

@codecov
Copy link

codecov bot commented Sep 22, 2022

Codecov Report

Merging #1606 (7f66e4f) into master (526dcb2) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1606   +/-   ##
=======================================
  Coverage   67.92%   67.92%           
=======================================
  Files         121      121           
  Lines        5022     5022           
=======================================
  Hits         3411     3411           
  Misses       1611     1611           
Flag Coverage Δ
unittests 67.92% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@voisardf voisardf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you already validated the generated xml after this fix?

Copy link
Collaborator

@vvmruder vvmruder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good :) Hope fed will be satisfied

@remyguillaume
Copy link

Have you already validated the generated xml after this fix?

Hello
I've just validate the generated XML according to the XSD, and I've noticed something else:

I get an error on this line :

<data:UpdateDateCS>
            ${extract.creation_date.strftime(date_format)}
</data:UpdateDateCS>

When validating, I get the following error:

>>> schema.validate(xml_doc)          
False
>>> schema.error_log
extract_test.xml:1071:0:ERROR:SCHEMASV:SCHEMAV_ELEMENT_CONTENT: Element '{http://schemas.geo.admin.ch/V_D/OeREB/2.0/ExtractData}SubunitOfLandRegister': This element is not expected. Expected is ( {http://schemas.geo.admin.ch/V_D/OeREB/2.0/ExtractData}MunicipalityCode ).
extract_test.xml:5586:0:ERROR:SCHEMASV:SCHEMAV_CVC_DATATYPE_VALID_1_2_1: Element '{http://schemas.geo.admin.ch/V_D/OeREB/2.0/ExtractData}UpdateDateCS': '
            2022-09-26T10:34:41
        ' is not a valid value of the local atomic type.

This was not noticed from Bund as an error, but the validation fails with standard python tools.
Just removing the carriage returns solves this issue, and then the validation passes 100%:

<data:UpdateDateCS>${extract.creation_date.strftime(date_format)}</data:UpdateDateCS>
>>> schema.validate(xml_doc)
True

I don't have the right to push on this branch, so if one of you would do this for me, it would be great !
Otherwise we can just wait that @svamaa returns from her holiday :)
Thanks 🙂

@svamaa
Copy link
Collaborator Author

svamaa commented Oct 3, 2022

Have you already validated the generated xml after this fix?

Hello I've just validate the generated XML according to the XSD, and I've noticed something else:

I get an error on this line :

<data:UpdateDateCS>
            ${extract.creation_date.strftime(date_format)}
</data:UpdateDateCS>

When validating, I get the following error:

>>> schema.validate(xml_doc)          
False
>>> schema.error_log
extract_test.xml:1071:0:ERROR:SCHEMASV:SCHEMAV_ELEMENT_CONTENT: Element '{http://schemas.geo.admin.ch/V_D/OeREB/2.0/ExtractData}SubunitOfLandRegister': This element is not expected. Expected is ( {http://schemas.geo.admin.ch/V_D/OeREB/2.0/ExtractData}MunicipalityCode ).
extract_test.xml:5586:0:ERROR:SCHEMASV:SCHEMAV_CVC_DATATYPE_VALID_1_2_1: Element '{http://schemas.geo.admin.ch/V_D/OeREB/2.0/ExtractData}UpdateDateCS': '
            2022-09-26T10:34:41
        ' is not a valid value of the local atomic type.

This was not noticed from Bund as an error, but the validation fails with standard python tools. Just removing the carriage returns solves this issue, and then the validation passes 100%:

<data:UpdateDateCS>${extract.creation_date.strftime(date_format)}</data:UpdateDateCS>
>>> schema.validate(xml_doc)
True

I don't have the right to push on this branch, so if one of you would do this for me, it would be great ! Otherwise we can just wait that @svamaa returns from her holiday :) Thanks 🙂

Done ;)

@svamaa
Copy link
Collaborator Author

svamaa commented Oct 3, 2022

In order to have all Tests valid, the new URLs for the FED data had to be changed and test_xml.py was adjusted.
This was done here too.

@voisardf
Copy link
Collaborator

voisardf commented Oct 5, 2022

@svamaa I think you can merge this PR. thanks!

@svamaa svamaa merged commit d04d75a into master Oct 5, 2022
@svamaa svamaa deleted the validate_xml branch October 5, 2022 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants