diff --git a/CustomerType.txt b/CustomerType.txt index 7647527..9d5053e 100644 --- a/CustomerType.txt +++ b/CustomerType.txt @@ -1,14 +1,93 @@ - def validate_StatusType1(self, value): - # Validate type StatusType1, a restriction on xs:string. +class GivenNameType(GeneratedsSuper): + __hash__ = GeneratedsSuper.__hash__ + subclass = None + superclass = None + def __init__(self, valueOf_=None, gds_collector_=None, **kwargs_): + self.gds_collector_ = gds_collector_ + self.gds_elementtree_node_ = None + self.original_tagname_ = None + self.parent_object_ = kwargs_.get('parent_object_') + self.ns_prefix_ = None + self.valueOf_ = valueOf_ + def factory(*args_, **kwargs_): + if CurrentSubclassModule_ is not None: + subclass = getSubclassFromModule_( + CurrentSubclassModule_, GivenNameType) + if subclass is not None: + return subclass(*args_, **kwargs_) + if GivenNameType.subclass: + return GivenNameType.subclass(*args_, **kwargs_) + else: + return GivenNameType(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ns_prefix_(self): + return self.ns_prefix_ + def set_ns_prefix_(self, ns_prefix): + self.ns_prefix_ = ns_prefix + def get_valueOf_(self): return self.valueOf_ + def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_ + def validate_StringLength1to64(self, value): + result = True + # Validate type StringLength1to64, a restriction on xs:string. if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None: if not isinstance(value, str): lineno = self.gds_get_node_lineno_() self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, }) return False - value = value - enumerations = ['ALPINEBITS_HANDSHAKE'] - if value not in enumerations: + if len(value) > 64: lineno = self.gds_get_node_lineno_() - self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on StatusType1' % {"value" : encode_str_2_3(value), "lineno": lineno} ) + self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on StringLength1to64' % {"value" : encode_str_2_3(value), "lineno": lineno} ) result = False - + if len(value) < 1: + lineno = self.gds_get_node_lineno_() + self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on StringLength1to64' % {"value" : encode_str_2_3(value), "lineno": lineno} ) + result = False + return result + def has__content(self): + if ( + (1 if type(self.valueOf_) in [int,float] else self.valueOf_) + ): + return True + else: + return False + def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='GivenNameType', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('GivenNameType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ + if pretty_print: + eol_ = '\n' + else: + eol_ = '' + if self.original_tagname_ is not None and name_ == 'GivenNameType': + name_ = self.original_tagname_ + if UseCapturedNS_ and self.ns_prefix_: + namespaceprefix_ = self.ns_prefix_ + ':' + showIndent(outfile, level, pretty_print) + outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = set() + self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='GivenNameType') + outfile.write('>') + self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_, pretty_print=pretty_print) + outfile.write(self.convert_unicode(self.valueOf_)) + outfile.write('%s' % (namespaceprefix_, name_, eol_)) + def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='GivenNameType'): + pass + def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='GivenNameType', fromsubclass_=False, pretty_print=True): + pass + def build(self, node, gds_collector_=None): + self.gds_collector_ = gds_collector_ + if SaveElementTreeNode: + self.gds_elementtree_node_ = node + already_processed = set() + self.ns_prefix_ = node.prefix + self._buildAttributes(node, node.attrib, already_processed) + self.valueOf_ = get_all_text_(node) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) + return self + def _buildAttributes(self, node, attrs, already_processed): + pass + def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): + pass +# end class GivenNameType \ No newline at end of file diff --git a/CustomerType125.txt b/CustomerType125.txt index 333e629..00ea463 100644 --- a/CustomerType125.txt +++ b/CustomerType125.txt @@ -1,13 +1,93 @@ - def validate_StatusType(self, value): - # Validate type StatusType, a restriction on xs:string. +class SurnameType(GeneratedsSuper): + __hash__ = GeneratedsSuper.__hash__ + subclass = None + superclass = None + def __init__(self, valueOf_=None, gds_collector_=None, **kwargs_): + self.gds_collector_ = gds_collector_ + self.gds_elementtree_node_ = None + self.original_tagname_ = None + self.parent_object_ = kwargs_.get('parent_object_') + self.ns_prefix_ = None + self.valueOf_ = valueOf_ + def factory(*args_, **kwargs_): + if CurrentSubclassModule_ is not None: + subclass = getSubclassFromModule_( + CurrentSubclassModule_, SurnameType) + if subclass is not None: + return subclass(*args_, **kwargs_) + if SurnameType.subclass: + return SurnameType.subclass(*args_, **kwargs_) + else: + return SurnameType(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ns_prefix_(self): + return self.ns_prefix_ + def set_ns_prefix_(self, ns_prefix): + self.ns_prefix_ = ns_prefix + def get_valueOf_(self): return self.valueOf_ + def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_ + def validate_StringLength1to64(self, value): + result = True + # Validate type StringLength1to64, a restriction on xs:string. if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None: if not isinstance(value, str): lineno = self.gds_get_node_lineno_() self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, }) return False - value = value - enumerations = ['ALPINEBITS_HANDSHAKE'] - if value not in enumerations: + if len(value) > 64: lineno = self.gds_get_node_lineno_() - self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on StatusType' % {"value" : encode_str_2_3(value), "lineno": lineno} ) - result = False \ No newline at end of file + self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd maxLength restriction on StringLength1to64' % {"value" : encode_str_2_3(value), "lineno": lineno} ) + result = False + if len(value) < 1: + lineno = self.gds_get_node_lineno_() + self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd minLength restriction on StringLength1to64' % {"value" : encode_str_2_3(value), "lineno": lineno} ) + result = False + return result + def has__content(self): + if ( + (1 if type(self.valueOf_) in [int,float] else self.valueOf_) + ): + return True + else: + return False + def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='SurnameType', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('SurnameType') + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ + if pretty_print: + eol_ = '\n' + else: + eol_ = '' + if self.original_tagname_ is not None and name_ == 'SurnameType': + name_ = self.original_tagname_ + if UseCapturedNS_ and self.ns_prefix_: + namespaceprefix_ = self.ns_prefix_ + ':' + showIndent(outfile, level, pretty_print) + outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = set() + self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='SurnameType') + outfile.write('>') + self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_, pretty_print=pretty_print) + outfile.write(self.convert_unicode(self.valueOf_)) + outfile.write('%s' % (namespaceprefix_, name_, eol_)) + def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='SurnameType'): + pass + def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='SurnameType', fromsubclass_=False, pretty_print=True): + pass + def build(self, node, gds_collector_=None): + self.gds_collector_ = gds_collector_ + if SaveElementTreeNode: + self.gds_elementtree_node_ = node + already_processed = set() + self.ns_prefix_ = node.prefix + self._buildAttributes(node, node.attrib, already_processed) + self.valueOf_ = get_all_text_(node) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) + return self + def _buildAttributes(self, node, attrs, already_processed): + pass + def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): + pass +# end class SurnameType \ No newline at end of file