Merge remote-tracking branch 'origin/master' into 0.11
[platform/upstream/gst-common.git] / mangle-tmpl.py
index dbd0566..bd4f948 100644 (file)
@@ -8,7 +8,7 @@ insert/overwrite Short Description and Long Description
 
 # FIXME: right now it uses pygst and scans on its own;
 # we really should use inspect/*.xml instead since the result of
-# gst-xmlinspect.py is commited by the docs maintainer, who can be
+# gst-xmlinspect.py is committed by the docs maintainer, who can be
 # expected to have pygst, but this step should be done for every docs build,
 # so no pygst allowed
 
@@ -116,7 +116,10 @@ def get_elements(file):
                 if e2.nodeType == e2.ELEMENT_NODE and e2.localName == 'name':
                     name = e2.childNodes[0].nodeValue.encode("UTF-8")
                 elif e2.nodeType == e2.ELEMENT_NODE and e2.localName == 'description':
-                    description = e2.childNodes[0].nodeValue.encode("UTF-8")
+                    if e2.childNodes:
+                      description = e2.childNodes[0].nodeValue.encode("UTF-8")
+                    else:
+                      description = 'No description'
 
             if name != None and description != None:
                 elements[name] = {'description': description}
@@ -148,7 +151,9 @@ def main():
 
         # put in an include if not yet there
         line = '<include xmlns="http://www.w3.org/2003/XInclude" href="' + \
-            'element-' + element + '-details.xml" />\n'
+            'element-' + element + '-details.xml">' + \
+            '<fallback xmlns="http://www.w3.org/2003/XInclude" />' + \
+            '</include>\n'
         section = tmpl.get_section("Long_Description")
         if not section[0]  == line:
             section.insert(0, line)