예제 #1
0
    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
예제 #2
0
    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
예제 #3
0
    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
예제 #4
0
    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