diff --git a/README.md b/README.md index fe310d3..e917e84 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ Le convertisseur est [converter.py](./converter.py). $ python converter.py l-systems.csv ``` + + ## Rapport diff --git a/converter.py b/converter.py index 825dc11..0bc7d6b 100644 --- a/converter.py +++ b/converter.py @@ -49,7 +49,7 @@ class System: break def __repr__(self): - return pformat(self.__dict__, compact=True, width=120, sort_dicts=False) + return pformat(object=self.__dict__, compact=True, width=120, sort_dicts=False) def to_xml(self) -> XMLElement: """Convert the current system into an XML element""" @@ -126,8 +126,11 @@ if __name__ == "__main__": # Generate XML xml = lsystems_xml(lsystems) + # Add XML model declaration + xml_string = '\n' + element_stringifier(xml).decode() + # Output XML - dom = xml_parser(element_stringifier(xml)) + dom = xml_parser(xml_string) pretty_xml = dom.toprettyxml(encoding="UTF-8").decode() if args.output: with open(args.output, "w") as output_file: diff --git a/data.xsd b/data.xsd new file mode 100644 index 0000000..59e298a --- /dev/null +++ b/data.xsd @@ -0,0 +1,7 @@ + + + + + + +