From 07863d0718e42a5a9916380301317fa668b576e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9munaire?= Date: Sat, 1 Sep 2012 15:50:24 +0200 Subject: [PATCH] In DATAS, attribute stated by _ are ignored --- xmlparser/node.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xmlparser/node.py b/xmlparser/node.py index 222f23a..7962e1b 100644 --- a/xmlparser/node.py +++ b/xmlparser/node.py @@ -148,10 +148,11 @@ class ModuleState: """Serialize this node as a XML node""" attribs = {} for att in self.attributes.keys(): - if isinstance(self.attributes[att], datetime): - attribs[att] = str(time.mktime(self.attributes[att].timetuple())) - else: - attribs[att] = str(self.attributes[att]) + if att[0] != "_": # Don't save attribute starting by _ + if isinstance(self.attributes[att], datetime): + attribs[att] = str(time.mktime(self.attributes[att].timetuple())) + else: + attribs[att] = str(self.attributes[att]) attrs = xml.sax.xmlreader.AttributesImpl(attribs) gen.startElement(self.name, attrs)