summaryrefslogtreecommitdiff
path: root/itstool.in
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2012-09-20 18:37:44 -0400
committerShaun McCance <shaunm@gnome.org>2012-09-20 18:37:44 -0400
commit5040a328ba73ec3dd119f013b9a12a2fdc99a6b9 (patch)
tree4e805c6b2ba28a68c38eeaeb100a3515186c8056 /itstool.in
parent7ee29a46d229bde60c86703730b24d5ac49a1e75 (diff)
downloaditstool-5040a328ba73ec3dd119f013b9a12a2fdc99a6b9.tar.gz
Support namespace prefixes on elements
Diffstat (limited to 'itstool.in')
-rwxr-xr-xitstool.in10
1 files changed, 8 insertions, 2 deletions
diff --git a/itstool.in b/itstool.in
index 3a21aaf..ed9d12f 100755
--- a/itstool.in
+++ b/itstool.in
@@ -208,7 +208,10 @@ class Message (object):
def add_start_tag (self, node):
if len(self._message) == 0 or not(isinstance(self._message[-1], basestring)):
self._message.append('')
- self._message[-1] += ('<%s' % node.name)
+ if node.ns() is not None and node.ns().name is not None:
+ self._message[-1] += ('<%s:%s' % (node.ns().name, node.name))
+ else:
+ self._message[-1] += ('<%s' % node.name)
if node.properties is not None:
for prop in node.properties:
if prop.type == 'attribute':
@@ -229,7 +232,10 @@ class Message (object):
if node.children is not None:
if len(self._message) == 0 or not(isinstance(self._message[-1], basestring)):
self._message.append('')
- self._message[-1] += (u'</%s>' % unicode(node.name, 'utf-8'))
+ if node.ns() is not None and node.ns().name is not None:
+ self._message[-1] += ('</%s:%s>' % (node.ns().name, node.name))
+ else:
+ self._message[-1] += ('</%s>' % node.name)
def is_empty (self):
return self._empty