示例#1
0
 def __create_generic_element(self, index, value):
     """
     Create a generic element based on the data found. Populate all the
     fields so that validation will pass.
     :param index: the position of the element for providing a name.
     :param value: the content for the element being created.
     :return: a generic element.
     """
     element = Element()
     element.name = "GEN" + str(index)
     element.content = value
     element.description = "A generic element created by the parser"
     element.required = False
     length = len(value)
     element.minLength = length
     element.maxLength = length
     return element
示例#2
0
 def __create_generic_element(self, index, value):
     """
     Create a generic element based on the data found. Populate all the
     fields so that validation will pass.
     :param index: the position of the element for providing a name.
     :param value: the content for the element being created.
     :return: a generic element.
     """
     element = Element()
     element.name = "GEN" + str(index)
     element.content = value
     element.description = "A generic element created by the parser"
     element.required = False
     length = len(value)
     element.minLength = length
     element.maxLength = length
     return element