def parse_xml(self, xml):
     '''
         :param key_xml: lxml.etree.Element representing a single VocabularyCodeSet
     '''
     xmlutils = XmlUtils(xml)
     self.name = xmlutils.get_string_by_xpath('name')
     self.family = xmlutils.get_string_by_xpath('family')
     self.version = xmlutils.get_string_by_xpath('version')
     for item in xml.xpath('code-item'):
         self.code_item.append(VocabularyCodeItem(item))
     self.is_vocab_truncated = xmlutils.get_bool_by_xpath('is-vocab-truncated')
     self.language = xmlutils.get_lang()
예제 #2
0
    def parse_xml(self, key_xml):
        '''
            Parse a VocabularyKey from an Xml as per Healthvault
            schema.

            :param key_xml: lxml.etree.Element representing a single VocabularyKey
        '''
        xmlutils = XmlUtils(key_xml)
        self.name = xmlutils.get_string_by_xpath('name')
        self.family = xmlutils.get_string_by_xpath('family')
        self.version = xmlutils.get_string_by_xpath('version')
        self.description = xmlutils.get_string_by_xpath('description')

        self.language = xmlutils.get_lang()