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

Sync OrganisationRegistrationAgency with upstream org-id.guide #407

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
org_id_xml = etree.parse(join('source', 'org-id-guide.xml'))
codelist_items = org_id_xml.find('codelist-items')

parser = etree.XMLParser(strip_cdata=False)
template = etree.parse(
join('templates', 'OrganisationRegistrationAgency.xml'))
join('templates', 'OrganisationRegistrationAgency.xml'),
parser=parser)
placeholder_codelist_items = template.find('codelist-items')

template.getroot().replace(placeholder_codelist_items, codelist_items)

etree.indent(template, space=' ')

template.write(
join('xml', 'OrganisationRegistrationAgency.xml'),
pretty_print=True)
encoding='utf-8')
5 changes: 4 additions & 1 deletion templates/OrganisationRegistrationAgency.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<codelist name="OrganisationRegistrationAgency" complete="0" xml:lang="en" category-codelist="Country">
<codelist name="OrganisationRegistrationAgency" complete="0" xml:lang="en" category-codelist="Country" embedded="0">
<metadata>
<name>
<narrative>Organisation Registration Agency</narrative>
Expand All @@ -14,6 +14,9 @@
If org-id.guide does not contain an entry for the kind of organisation you need to identify, you can make a request a new list is included in the register following the `guidance <http://docs.org-id.guide/en/latest/contribute/>`__ or by getting in touch with org-id.guide at: [email protected].
]]></narrative>
</description>
<category>
<narrative>Replicated</narrative>
</category>
</metadata>
<codelist-items/>
</codelist>
Loading
Loading