def to_xml(self, dom): # TODO: Return error codes instead? assert self.note_record_id is not None and self.author_name is not None pxml = dom.createElementNS(PFIF_13_NS, "note") for attr in PFIF_13_NOTE_ATTRS: if getattr(self, attr) is not None: add_string_element(dom, pxml, PFIF_13_NS, attr, getattr(self, attr)) return pxml
def to_xml(self, dom): # TODO: Return error codes instead? assert self.note_record_id is not None and \ self.author_name is not None pxml = dom.createElementNS(PFIF_13_NS, "note") for attr in PFIF_13_NOTE_ATTRS: if getattr(self, attr) is not None: add_string_element(dom, pxml, PFIF_13_NS, attr, getattr(self, attr)) return pxml
def to_xml(self, dom): # TODO: Return error codes instead? assert self.person_record_id is not None and self.first_name is not None and self.last_name is not None pxml = dom.createElementNS(PFIF_13_NS, "person") for attr in PFIF_13_PERSON_ATTRS: if getattr(self, attr) is not None: add_string_element(dom, pxml, PFIF_13_NS, attr, getattr(self, attr)) for note in self.notes: pxml.appendChild(note.to_xml(dom)) return pxml
def to_xml(self, dom): # TODO: Return error codes instead? assert self.person_record_id is not None and \ self.first_name is not None and \ self.last_name is not None pxml = dom.createElementNS(PFIF_13_NS, "person") for attr in PFIF_13_PERSON_ATTRS: if getattr(self, attr) is not None: add_string_element(dom, pxml, PFIF_13_NS, attr, getattr(self, attr)) for note in self.notes: pxml.appendChild(note.to_xml(dom)) return pxml