aboutsummaryrefslogtreecommitdiffstats
path: root/lv2specgen/lv2specgen.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-24 19:33:11 +0100
committerDavid Robillard <d@drobilla.net>2019-03-24 21:23:03 +0100
commit8c5541cbe44d10769cc4d6c72c9cb142ca7a4c20 (patch)
tree199d65ae4a16027856f4b15a98fc5d2dbdd40caa /lv2specgen/lv2specgen.py
parentc5bb8d806d72ec9340188c558fab8d972db7891f (diff)
downloadlv2-8c5541cbe44d10769cc4d6c72c9cb142ca7a4c20.tar.xz
Add validation for complete specification page
Diffstat (limited to 'lv2specgen/lv2specgen.py')
-rwxr-xr-xlv2specgen/lv2specgen.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py
index e280b25..1b6400e 100755
--- a/lv2specgen/lv2specgen.py
+++ b/lv2specgen/lv2specgen.py
@@ -1386,6 +1386,19 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, root
if index_path is not None:
writeIndex(m, specloc, index_path, root_path, root_uri)
+ # Validate complete output page
+ try:
+ oldcwd = os.getcwd()
+ os.chdir(specgendir)
+ root = etree.fromstring(
+ template.replace('"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"',
+ '"DTD/xhtml-rdfa-1.dtd"').encode('utf-8'),
+ etree.XMLParser(dtd_validation=True, no_network=True))
+ except Exception as e:
+ sys.stderr.write("error: Validation failed for %s: %s" % (specloc, e))
+ finally:
+ os.chdir(oldcwd)
+
return template