summaryrefslogtreecommitdiff
path: root/giscanner/xmlwriter.py
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-07-07 18:18:37 -0400
committerColin Walters <walters@verbum.org>2010-07-08 14:42:54 -0400
commit017727630d09a854b1c1a4767066fb675b139de9 (patch)
tree015b9692d2225f1dbe6c6bacb37aae7ff8c54f82 /giscanner/xmlwriter.py
parentcb268efadd68c0d67965e683a26966d760cd33ca (diff)
downloadgobject-introspection-017727630d09a854b1c1a4767066fb675b139de9.tar.gz
Move doc to toplevel element, write <any> for unknown containers
Moving to <doc> allows us to better preserve whitespace. XML has no facility for whitespace-preserving attributes. Second, for arrays and lists, both types with unknown element_type can occur in the current scanner; it's least wrong if we write out an <any> type.
Diffstat (limited to 'giscanner/xmlwriter.py')
-rw-r--r--giscanner/xmlwriter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/giscanner/xmlwriter.py b/giscanner/xmlwriter.py
index 3068e62e..0db286bb 100644
--- a/giscanner/xmlwriter.py
+++ b/giscanner/xmlwriter.py
@@ -22,7 +22,7 @@ from __future__ import with_statement
from contextlib import contextmanager
from cStringIO import StringIO
-from xml.sax.saxutils import quoteattr
+from xml.sax.saxutils import escape, quoteattr
from .libtoolimporter import LibtoolImporter
@@ -111,7 +111,7 @@ class XMLWriter(object):
attributes = []
prefix = '<%s' % (tag_name, )
if data is not None:
- suffix = '>%s</%s>' % (data, tag_name)
+ suffix = '>%s</%s>' % (escape(data), tag_name)
else:
suffix = '/>'
attrs = collect_attributes(