Skip to content

Commit

Permalink
Fix codelist attribute linkage, fixes #35
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb committed Apr 11, 2014
1 parent 500ad27 commit b2aa650
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion IATI-Schemas
Submodule IATI-Schemas updated 1 files
+4 −2 iati-common.xsd
6 changes: 3 additions & 3 deletions gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@ def output_docs(self, element_name, path, element=None):
children = self.element_loop(element, path)
for child_name, child_element in children:
self.output_docs(child_name, path+element.attrib['name']+'/', child_element)

with open('docs/'+rst_filename, 'w') as fp:
t = self.jinja_env.get_template(self.lang+'/schema_element.rst')
fp.write(t.render(
element_name=element_name,
element_name_underline='='*len(element_name),
element=element,
path='/'.join(path.split('/')[1:]),
path='/'.join(path.split('/')[1:]), # Strip e.g. activity-standard/ from the path
github_urls=github_urls,
schema_documentation=textwrap.dedent(element.find(".//xsd:documentation", namespaces=namespaces).text),
extended_types=element.xpath('xsd:complexType/xsd:simpleContent/xsd:extension/@base', namespaces=namespaces),
Expand Down Expand Up @@ -251,7 +251,7 @@ def output_schema_table(self, element_name, path, element=None, output=False, fi
fp.write(t.render(
rows=rows,
title=title,
root_path=path,
root_path='/'.join(path.split('/')[1:]), # Strip e.g. activity-standard/ from the path
match_codelist=match_codelist,
description=self.tree.xpath('xsd:annotation/xsd:documentation[@xml:lang="en"]', namespaces=namespaces)[0].text
).encode('utf8'))
Expand Down

0 comments on commit b2aa650

Please sign in to comment.