diff options
author | Matěj Cepl <mcepl@redhat.com> | 2012-09-21 08:56:23 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2012-09-21 08:56:23 +0200 |
commit | d10067411278d779b986fc90009deeaa22ef51de (patch) | |
tree | aaa60446de20c139dd4d9b2925a19dac8b993b5b /generate_html.py | |
parent | 6bd96be67dcfd6261a4c847fd98c215601591926 (diff) | |
download | hesla-d10067411278d779b986fc90009deeaa22ef51de.tar.gz |
Add DOCTYPE.
Also input file name should not be hardcoded.
Diffstat (limited to 'generate_html.py')
-rw-r--r-- | generate_html.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/generate_html.py b/generate_html.py index 43a84ef..8c6a637 100644 --- a/generate_html.py +++ b/generate_html.py @@ -2,6 +2,7 @@ import re import codecs from xml.etree import ElementTree as et +import sys import logging #logging.basicConfig(level=logging.DEBUG) @@ -101,7 +102,7 @@ def parse_file(filename): for los in tree.getiterator("LOSUNG"): body.append(parse_one(los)) - return et.tostring(doc, encoding="utf-8") + return "<!DOCTYPE html>\n" + et.tostring(doc, encoding="utf-8") if __name__ == "__main__": - print(parse_file("hes12-01.xml")) + print(parse_file(sys.argv[1])) |