def xml_instance(self, **kwargs): result = Section.xml_instance(self, **kwargs) # set these first to prevent overwriting id and version for key, value in self.attribute.items(): result.setAttribute(unicode(key), value) result.setAttribute("id", self.id_string) # add instance xmlns attribute to the instance node if self.instance_xmlns: result.setAttribute("xmlns", self.instance_xmlns) if self.version: result.setAttribute("version", self.version) if self.generated_by: result.setAttribute("odk:generated-by", self.generated_by) if self.prefix: result.setAttribute("odk:prefix", self.prefix) if self.delimiter: result.setAttribute("odk:delimiter", self.delimiter) return result
def xml_instance(self): result = Section.xml_instance(self) # set these first to prevent overwriting id and version for key, value in self.attribute.items(): result.setAttribute(unicode(key), value) result.setAttribute(u"id", self.id_string) # add instance xmlns attribute to the instance node if self.instance_xmlns: result.setAttribute(u"xmlns", self.instance_xmlns) if self.version: result.setAttribute(u"version", self.version) return result
def xml_instance(self, **kwargs): result = Section.xml_instance(self, **kwargs) # set these first to prevent overwriting id and version for key, value in self.attribute.items(): result.setAttribute(unicode(key), value) result.setAttribute("id", self.id_string) # add instance xmlns attribute to the instance node if self.instance_xmlns: result.setAttribute("xmlns", self.instance_xmlns) if self.version: result.setAttribute("version", self.version) if self.prefix: result.setAttribute("odk:prefix", self.prefix) if self.delimiter: result.setAttribute("odk:delimiter", self.delimiter) return result