XSD: default value of a missing element

后端 未结 2 1059
隐瞒了意图╮
隐瞒了意图╮ 2021-01-11 16:18

Is it possible to define a default value for a missing element in an XML Schema. I have the following snippet:



        
2条回答
  •  無奈伤痛
    2021-01-11 16:48

    call this function

    def _get_(x):
      if x is not None:
         return(x.text)
      else:
        # print('Setting Blank')
         return ''
    _get_(parent.find('childtag'))
    

提交回复
热议问题