@@ 5951-6075 (lines=125) @@ | ||
5948 | # end class TextEquivType |
|
5949 | ||
5950 | ||
5951 | class GridType(GeneratedsSuper): |
|
5952 | """GridType -- |
|
5953 | Matrix of grid points defining the table grid on the page. |
|
5954 | ||
5955 | * GridPoints -- |
|
5956 | One row in the grid point matrix. |
|
5957 | Points with x,y coordinates. |
|
5958 | (note: for a table with n table rows there should be n+1 grid rows) |
|
5959 | ||
5960 | """ |
|
5961 | __hash__ = GeneratedsSuper.__hash__ |
|
5962 | member_data_items_ = [ |
|
5963 | MemberSpec_('GridPoints', 'GridPointsType', 1, 0, {'maxOccurs': 'unbounded', 'minOccurs': '2', 'name': 'GridPoints', 'type': 'GridPointsType'}, None), |
|
5964 | ] |
|
5965 | subclass = None |
|
5966 | superclass = None |
|
5967 | def __init__(self, GridPoints=None, gds_collector_=None, **kwargs_): |
|
5968 | self.gds_collector_ = gds_collector_ |
|
5969 | self.gds_elementtree_node_ = None |
|
5970 | self.original_tagname_ = None |
|
5971 | self.parent_object_ = kwargs_.get('parent_object_') |
|
5972 | self.ns_prefix_ = "pc" |
|
5973 | if GridPoints is None: |
|
5974 | self.GridPoints = [] |
|
5975 | else: |
|
5976 | self.GridPoints = GridPoints |
|
5977 | self.GridPoints_nsprefix_ = "pc" |
|
5978 | def factory(*args_, **kwargs_): |
|
5979 | if CurrentSubclassModule_ is not None: |
|
5980 | subclass = getSubclassFromModule_( |
|
5981 | CurrentSubclassModule_, GridType) |
|
5982 | if subclass is not None: |
|
5983 | return subclass(*args_, **kwargs_) |
|
5984 | if GridType.subclass: |
|
5985 | return GridType.subclass(*args_, **kwargs_) |
|
5986 | else: |
|
5987 | return GridType(*args_, **kwargs_) |
|
5988 | factory = staticmethod(factory) |
|
5989 | def get_ns_prefix_(self): |
|
5990 | return self.ns_prefix_ |
|
5991 | def set_ns_prefix_(self, ns_prefix): |
|
5992 | self.ns_prefix_ = ns_prefix |
|
5993 | def get_GridPoints(self): |
|
5994 | return self.GridPoints |
|
5995 | def set_GridPoints(self, GridPoints): |
|
5996 | self.GridPoints = GridPoints |
|
5997 | def add_GridPoints(self, value): |
|
5998 | self.GridPoints.append(value) |
|
5999 | def insert_GridPoints_at(self, index, value): |
|
6000 | self.GridPoints.insert(index, value) |
|
6001 | def replace_GridPoints_at(self, index, value): |
|
6002 | self.GridPoints[index] = value |
|
6003 | def has__content(self): |
|
6004 | if ( |
|
6005 | self.GridPoints |
|
6006 | ): |
|
6007 | return True |
|
6008 | else: |
|
6009 | return False |
|
6010 | def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"', name_='GridType', pretty_print=True): |
|
6011 | imported_ns_def_ = GenerateDSNamespaceDefs_.get('GridType') |
|
6012 | if imported_ns_def_ is not None: |
|
6013 | namespacedef_ = imported_ns_def_ |
|
6014 | if pretty_print: |
|
6015 | eol_ = '\n' |
|
6016 | else: |
|
6017 | eol_ = '' |
|
6018 | if self.original_tagname_ is not None and name_ == 'GridType': |
|
6019 | name_ = self.original_tagname_ |
|
6020 | if UseCapturedNS_ and self.ns_prefix_: |
|
6021 | namespaceprefix_ = self.ns_prefix_ + ':' |
|
6022 | showIndent(outfile, level, pretty_print) |
|
6023 | outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) |
|
6024 | already_processed = set() |
|
6025 | self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='GridType') |
|
6026 | if self.has__content(): |
|
6027 | outfile.write('>%s' % (eol_, )) |
|
6028 | self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='GridType', pretty_print=pretty_print) |
|
6029 | showIndent(outfile, level, pretty_print) |
|
6030 | outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) |
|
6031 | else: |
|
6032 | outfile.write('/>%s' % (eol_, )) |
|
6033 | def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='GridType'): |
|
6034 | pass |
|
6035 | def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"', name_='GridType', fromsubclass_=False, pretty_print=True): |
|
6036 | if pretty_print: |
|
6037 | eol_ = '\n' |
|
6038 | else: |
|
6039 | eol_ = '' |
|
6040 | for GridPoints_ in self.GridPoints: |
|
6041 | namespaceprefix_ = self.GridPoints_nsprefix_ + ':' if (UseCapturedNS_ and self.GridPoints_nsprefix_) else '' |
|
6042 | GridPoints_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='GridPoints', pretty_print=pretty_print) |
|
6043 | def to_etree(self, parent_element=None, name_='GridType', mapping_=None, reverse_mapping_=None, nsmap_=None): |
|
6044 | if parent_element is None: |
|
6045 | element = etree_.Element('{http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15}' + name_, nsmap=nsmap_) |
|
6046 | else: |
|
6047 | element = etree_.SubElement(parent_element, '{http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15}' + name_, nsmap=nsmap_) |
|
6048 | for GridPoints_ in self.GridPoints: |
|
6049 | GridPoints_.to_etree(element, name_='GridPoints', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_) |
|
6050 | if mapping_ is not None: |
|
6051 | mapping_[id(self)] = element |
|
6052 | if reverse_mapping_ is not None: |
|
6053 | reverse_mapping_[element] = self |
|
6054 | return element |
|
6055 | def build(self, node, gds_collector_=None): |
|
6056 | self.gds_collector_ = gds_collector_ |
|
6057 | if SaveElementTreeNode: |
|
6058 | self.gds_elementtree_node_ = node |
|
6059 | already_processed = set() |
|
6060 | self.ns_prefix_ = node.prefix |
|
6061 | self._buildAttributes(node, node.attrib, already_processed) |
|
6062 | for child in node: |
|
6063 | nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] |
|
6064 | self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) |
|
6065 | return self |
|
6066 | def _buildAttributes(self, node, attrs, already_processed): |
|
6067 | pass |
|
6068 | def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): |
|
6069 | if nodeName_ == 'GridPoints': |
|
6070 | obj_ = GridPointsType.factory(parent_object_=self) |
|
6071 | obj_.build(child_, gds_collector_=gds_collector_) |
|
6072 | self.GridPoints.append(obj_) |
|
6073 | obj_.original_tagname_ = 'GridPoints' |
|
6074 | def __hash__(self): |
|
6075 | return hash(self.id) |
|
6076 | # end class GridType |
|
6077 | ||
6078 | ||
@@ 9025-9146 (lines=122) @@ | ||
9022 | # end class BaselineType |
|
9023 | ||
9024 | ||
9025 | class RelationsType(GeneratedsSuper): |
|
9026 | """RelationsType -- |
|
9027 | Container for one-to-one relations between layout |
|
9028 | objects (for example: DropCap - paragraph, caption - |
|
9029 | image). |
|
9030 | ||
9031 | """ |
|
9032 | __hash__ = GeneratedsSuper.__hash__ |
|
9033 | member_data_items_ = [ |
|
9034 | MemberSpec_('Relation', 'RelationType', 1, 0, {'maxOccurs': 'unbounded', 'minOccurs': '1', 'name': 'Relation', 'type': 'RelationType'}, None), |
|
9035 | ] |
|
9036 | subclass = None |
|
9037 | superclass = None |
|
9038 | def __init__(self, Relation=None, gds_collector_=None, **kwargs_): |
|
9039 | self.gds_collector_ = gds_collector_ |
|
9040 | self.gds_elementtree_node_ = None |
|
9041 | self.original_tagname_ = None |
|
9042 | self.parent_object_ = kwargs_.get('parent_object_') |
|
9043 | self.ns_prefix_ = "pc" |
|
9044 | if Relation is None: |
|
9045 | self.Relation = [] |
|
9046 | else: |
|
9047 | self.Relation = Relation |
|
9048 | self.Relation_nsprefix_ = "pc" |
|
9049 | def factory(*args_, **kwargs_): |
|
9050 | if CurrentSubclassModule_ is not None: |
|
9051 | subclass = getSubclassFromModule_( |
|
9052 | CurrentSubclassModule_, RelationsType) |
|
9053 | if subclass is not None: |
|
9054 | return subclass(*args_, **kwargs_) |
|
9055 | if RelationsType.subclass: |
|
9056 | return RelationsType.subclass(*args_, **kwargs_) |
|
9057 | else: |
|
9058 | return RelationsType(*args_, **kwargs_) |
|
9059 | factory = staticmethod(factory) |
|
9060 | def get_ns_prefix_(self): |
|
9061 | return self.ns_prefix_ |
|
9062 | def set_ns_prefix_(self, ns_prefix): |
|
9063 | self.ns_prefix_ = ns_prefix |
|
9064 | def get_Relation(self): |
|
9065 | return self.Relation |
|
9066 | def set_Relation(self, Relation): |
|
9067 | self.Relation = Relation |
|
9068 | def add_Relation(self, value): |
|
9069 | self.Relation.append(value) |
|
9070 | def insert_Relation_at(self, index, value): |
|
9071 | self.Relation.insert(index, value) |
|
9072 | def replace_Relation_at(self, index, value): |
|
9073 | self.Relation[index] = value |
|
9074 | def has__content(self): |
|
9075 | if ( |
|
9076 | self.Relation |
|
9077 | ): |
|
9078 | return True |
|
9079 | else: |
|
9080 | return False |
|
9081 | def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"', name_='RelationsType', pretty_print=True): |
|
9082 | imported_ns_def_ = GenerateDSNamespaceDefs_.get('RelationsType') |
|
9083 | if imported_ns_def_ is not None: |
|
9084 | namespacedef_ = imported_ns_def_ |
|
9085 | if pretty_print: |
|
9086 | eol_ = '\n' |
|
9087 | else: |
|
9088 | eol_ = '' |
|
9089 | if self.original_tagname_ is not None and name_ == 'RelationsType': |
|
9090 | name_ = self.original_tagname_ |
|
9091 | if UseCapturedNS_ and self.ns_prefix_: |
|
9092 | namespaceprefix_ = self.ns_prefix_ + ':' |
|
9093 | showIndent(outfile, level, pretty_print) |
|
9094 | outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) |
|
9095 | already_processed = set() |
|
9096 | self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='RelationsType') |
|
9097 | if self.has__content(): |
|
9098 | outfile.write('>%s' % (eol_, )) |
|
9099 | self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='RelationsType', pretty_print=pretty_print) |
|
9100 | showIndent(outfile, level, pretty_print) |
|
9101 | outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) |
|
9102 | else: |
|
9103 | outfile.write('/>%s' % (eol_, )) |
|
9104 | def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='RelationsType'): |
|
9105 | pass |
|
9106 | def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"', name_='RelationsType', fromsubclass_=False, pretty_print=True): |
|
9107 | if pretty_print: |
|
9108 | eol_ = '\n' |
|
9109 | else: |
|
9110 | eol_ = '' |
|
9111 | for Relation_ in self.Relation: |
|
9112 | namespaceprefix_ = self.Relation_nsprefix_ + ':' if (UseCapturedNS_ and self.Relation_nsprefix_) else '' |
|
9113 | Relation_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='Relation', pretty_print=pretty_print) |
|
9114 | def to_etree(self, parent_element=None, name_='RelationsType', mapping_=None, reverse_mapping_=None, nsmap_=None): |
|
9115 | if parent_element is None: |
|
9116 | element = etree_.Element('{http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15}' + name_, nsmap=nsmap_) |
|
9117 | else: |
|
9118 | element = etree_.SubElement(parent_element, '{http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15}' + name_, nsmap=nsmap_) |
|
9119 | for Relation_ in self.Relation: |
|
9120 | Relation_.to_etree(element, name_='Relation', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_) |
|
9121 | if mapping_ is not None: |
|
9122 | mapping_[id(self)] = element |
|
9123 | if reverse_mapping_ is not None: |
|
9124 | reverse_mapping_[element] = self |
|
9125 | return element |
|
9126 | def build(self, node, gds_collector_=None): |
|
9127 | self.gds_collector_ = gds_collector_ |
|
9128 | if SaveElementTreeNode: |
|
9129 | self.gds_elementtree_node_ = node |
|
9130 | already_processed = set() |
|
9131 | self.ns_prefix_ = node.prefix |
|
9132 | self._buildAttributes(node, node.attrib, already_processed) |
|
9133 | for child in node: |
|
9134 | nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] |
|
9135 | self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) |
|
9136 | return self |
|
9137 | def _buildAttributes(self, node, attrs, already_processed): |
|
9138 | pass |
|
9139 | def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): |
|
9140 | if nodeName_ == 'Relation': |
|
9141 | obj_ = RelationType.factory(parent_object_=self) |
|
9142 | obj_.build(child_, gds_collector_=gds_collector_) |
|
9143 | self.Relation.append(obj_) |
|
9144 | obj_.original_tagname_ = 'Relation' |
|
9145 | def __hash__(self): |
|
9146 | return hash(self.id) |
|
9147 | # end class RelationsType |
|
9148 | ||
9149 | ||
@@ 8583-8704 (lines=122) @@ | ||
8580 | # end class BorderType |
|
8581 | ||
8582 | ||
8583 | class LayersType(GeneratedsSuper): |
|
8584 | """LayersType -- |
|
8585 | Can be used to express the z-index of overlapping |
|
8586 | regions. An element with a greater z-index is always in |
|
8587 | front of another element with lower z-index. |
|
8588 | ||
8589 | """ |
|
8590 | __hash__ = GeneratedsSuper.__hash__ |
|
8591 | member_data_items_ = [ |
|
8592 | MemberSpec_('Layer', 'LayerType', 1, 0, {'maxOccurs': 'unbounded', 'minOccurs': '1', 'name': 'Layer', 'type': 'LayerType'}, None), |
|
8593 | ] |
|
8594 | subclass = None |
|
8595 | superclass = None |
|
8596 | def __init__(self, Layer=None, gds_collector_=None, **kwargs_): |
|
8597 | self.gds_collector_ = gds_collector_ |
|
8598 | self.gds_elementtree_node_ = None |
|
8599 | self.original_tagname_ = None |
|
8600 | self.parent_object_ = kwargs_.get('parent_object_') |
|
8601 | self.ns_prefix_ = "pc" |
|
8602 | if Layer is None: |
|
8603 | self.Layer = [] |
|
8604 | else: |
|
8605 | self.Layer = Layer |
|
8606 | self.Layer_nsprefix_ = "pc" |
|
8607 | def factory(*args_, **kwargs_): |
|
8608 | if CurrentSubclassModule_ is not None: |
|
8609 | subclass = getSubclassFromModule_( |
|
8610 | CurrentSubclassModule_, LayersType) |
|
8611 | if subclass is not None: |
|
8612 | return subclass(*args_, **kwargs_) |
|
8613 | if LayersType.subclass: |
|
8614 | return LayersType.subclass(*args_, **kwargs_) |
|
8615 | else: |
|
8616 | return LayersType(*args_, **kwargs_) |
|
8617 | factory = staticmethod(factory) |
|
8618 | def get_ns_prefix_(self): |
|
8619 | return self.ns_prefix_ |
|
8620 | def set_ns_prefix_(self, ns_prefix): |
|
8621 | self.ns_prefix_ = ns_prefix |
|
8622 | def get_Layer(self): |
|
8623 | return self.Layer |
|
8624 | def set_Layer(self, Layer): |
|
8625 | self.Layer = Layer |
|
8626 | def add_Layer(self, value): |
|
8627 | self.Layer.append(value) |
|
8628 | def insert_Layer_at(self, index, value): |
|
8629 | self.Layer.insert(index, value) |
|
8630 | def replace_Layer_at(self, index, value): |
|
8631 | self.Layer[index] = value |
|
8632 | def has__content(self): |
|
8633 | if ( |
|
8634 | self.Layer |
|
8635 | ): |
|
8636 | return True |
|
8637 | else: |
|
8638 | return False |
|
8639 | def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"', name_='LayersType', pretty_print=True): |
|
8640 | imported_ns_def_ = GenerateDSNamespaceDefs_.get('LayersType') |
|
8641 | if imported_ns_def_ is not None: |
|
8642 | namespacedef_ = imported_ns_def_ |
|
8643 | if pretty_print: |
|
8644 | eol_ = '\n' |
|
8645 | else: |
|
8646 | eol_ = '' |
|
8647 | if self.original_tagname_ is not None and name_ == 'LayersType': |
|
8648 | name_ = self.original_tagname_ |
|
8649 | if UseCapturedNS_ and self.ns_prefix_: |
|
8650 | namespaceprefix_ = self.ns_prefix_ + ':' |
|
8651 | showIndent(outfile, level, pretty_print) |
|
8652 | outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) |
|
8653 | already_processed = set() |
|
8654 | self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='LayersType') |
|
8655 | if self.has__content(): |
|
8656 | outfile.write('>%s' % (eol_, )) |
|
8657 | self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='LayersType', pretty_print=pretty_print) |
|
8658 | showIndent(outfile, level, pretty_print) |
|
8659 | outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) |
|
8660 | else: |
|
8661 | outfile.write('/>%s' % (eol_, )) |
|
8662 | def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='LayersType'): |
|
8663 | pass |
|
8664 | def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"', name_='LayersType', fromsubclass_=False, pretty_print=True): |
|
8665 | if pretty_print: |
|
8666 | eol_ = '\n' |
|
8667 | else: |
|
8668 | eol_ = '' |
|
8669 | for Layer_ in self.Layer: |
|
8670 | namespaceprefix_ = self.Layer_nsprefix_ + ':' if (UseCapturedNS_ and self.Layer_nsprefix_) else '' |
|
8671 | Layer_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='Layer', pretty_print=pretty_print) |
|
8672 | def to_etree(self, parent_element=None, name_='LayersType', mapping_=None, reverse_mapping_=None, nsmap_=None): |
|
8673 | if parent_element is None: |
|
8674 | element = etree_.Element('{http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15}' + name_, nsmap=nsmap_) |
|
8675 | else: |
|
8676 | element = etree_.SubElement(parent_element, '{http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15}' + name_, nsmap=nsmap_) |
|
8677 | for Layer_ in self.Layer: |
|
8678 | Layer_.to_etree(element, name_='Layer', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_) |
|
8679 | if mapping_ is not None: |
|
8680 | mapping_[id(self)] = element |
|
8681 | if reverse_mapping_ is not None: |
|
8682 | reverse_mapping_[element] = self |
|
8683 | return element |
|
8684 | def build(self, node, gds_collector_=None): |
|
8685 | self.gds_collector_ = gds_collector_ |
|
8686 | if SaveElementTreeNode: |
|
8687 | self.gds_elementtree_node_ = node |
|
8688 | already_processed = set() |
|
8689 | self.ns_prefix_ = node.prefix |
|
8690 | self._buildAttributes(node, node.attrib, already_processed) |
|
8691 | for child in node: |
|
8692 | nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] |
|
8693 | self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) |
|
8694 | return self |
|
8695 | def _buildAttributes(self, node, attrs, already_processed): |
|
8696 | pass |
|
8697 | def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): |
|
8698 | if nodeName_ == 'Layer': |
|
8699 | obj_ = LayerType.factory(parent_object_=self) |
|
8700 | obj_.build(child_, gds_collector_=gds_collector_) |
|
8701 | self.Layer.append(obj_) |
|
8702 | obj_.original_tagname_ = 'Layer' |
|
8703 | def __hash__(self): |
|
8704 | return hash(self.id) |
|
8705 | # end class LayersType |
|
8706 | ||
8707 | ||
@@ 11634-11752 (lines=119) @@ | ||
11631 | # end class GraphemeGroupType |
|
11632 | ||
11633 | ||
11634 | class UserDefinedType(GeneratedsSuper): |
|
11635 | """UserDefinedType -- Container for user-defined attributes |
|
11636 | ||
11637 | """ |
|
11638 | __hash__ = GeneratedsSuper.__hash__ |
|
11639 | member_data_items_ = [ |
|
11640 | MemberSpec_('UserAttribute', 'UserAttributeType', 1, 0, {'maxOccurs': 'unbounded', 'minOccurs': '1', 'name': 'UserAttribute', 'type': 'UserAttributeType'}, None), |
|
11641 | ] |
|
11642 | subclass = None |
|
11643 | superclass = None |
|
11644 | def __init__(self, UserAttribute=None, gds_collector_=None, **kwargs_): |
|
11645 | self.gds_collector_ = gds_collector_ |
|
11646 | self.gds_elementtree_node_ = None |
|
11647 | self.original_tagname_ = None |
|
11648 | self.parent_object_ = kwargs_.get('parent_object_') |
|
11649 | self.ns_prefix_ = "pc" |
|
11650 | if UserAttribute is None: |
|
11651 | self.UserAttribute = [] |
|
11652 | else: |
|
11653 | self.UserAttribute = UserAttribute |
|
11654 | self.UserAttribute_nsprefix_ = "pc" |
|
11655 | def factory(*args_, **kwargs_): |
|
11656 | if CurrentSubclassModule_ is not None: |
|
11657 | subclass = getSubclassFromModule_( |
|
11658 | CurrentSubclassModule_, UserDefinedType) |
|
11659 | if subclass is not None: |
|
11660 | return subclass(*args_, **kwargs_) |
|
11661 | if UserDefinedType.subclass: |
|
11662 | return UserDefinedType.subclass(*args_, **kwargs_) |
|
11663 | else: |
|
11664 | return UserDefinedType(*args_, **kwargs_) |
|
11665 | factory = staticmethod(factory) |
|
11666 | def get_ns_prefix_(self): |
|
11667 | return self.ns_prefix_ |
|
11668 | def set_ns_prefix_(self, ns_prefix): |
|
11669 | self.ns_prefix_ = ns_prefix |
|
11670 | def get_UserAttribute(self): |
|
11671 | return self.UserAttribute |
|
11672 | def set_UserAttribute(self, UserAttribute): |
|
11673 | self.UserAttribute = UserAttribute |
|
11674 | def add_UserAttribute(self, value): |
|
11675 | self.UserAttribute.append(value) |
|
11676 | def insert_UserAttribute_at(self, index, value): |
|
11677 | self.UserAttribute.insert(index, value) |
|
11678 | def replace_UserAttribute_at(self, index, value): |
|
11679 | self.UserAttribute[index] = value |
|
11680 | def has__content(self): |
|
11681 | if ( |
|
11682 | self.UserAttribute |
|
11683 | ): |
|
11684 | return True |
|
11685 | else: |
|
11686 | return False |
|
11687 | def export(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"', name_='UserDefinedType', pretty_print=True): |
|
11688 | imported_ns_def_ = GenerateDSNamespaceDefs_.get('UserDefinedType') |
|
11689 | if imported_ns_def_ is not None: |
|
11690 | namespacedef_ = imported_ns_def_ |
|
11691 | if pretty_print: |
|
11692 | eol_ = '\n' |
|
11693 | else: |
|
11694 | eol_ = '' |
|
11695 | if self.original_tagname_ is not None and name_ == 'UserDefinedType': |
|
11696 | name_ = self.original_tagname_ |
|
11697 | if UseCapturedNS_ and self.ns_prefix_: |
|
11698 | namespaceprefix_ = self.ns_prefix_ + ':' |
|
11699 | showIndent(outfile, level, pretty_print) |
|
11700 | outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) |
|
11701 | already_processed = set() |
|
11702 | self._exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='UserDefinedType') |
|
11703 | if self.has__content(): |
|
11704 | outfile.write('>%s' % (eol_, )) |
|
11705 | self._exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='UserDefinedType', pretty_print=pretty_print) |
|
11706 | showIndent(outfile, level, pretty_print) |
|
11707 | outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_)) |
|
11708 | else: |
|
11709 | outfile.write('/>%s' % (eol_, )) |
|
11710 | def _exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='UserDefinedType'): |
|
11711 | pass |
|
11712 | def _exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15"', name_='UserDefinedType', fromsubclass_=False, pretty_print=True): |
|
11713 | if pretty_print: |
|
11714 | eol_ = '\n' |
|
11715 | else: |
|
11716 | eol_ = '' |
|
11717 | for UserAttribute_ in self.UserAttribute: |
|
11718 | namespaceprefix_ = self.UserAttribute_nsprefix_ + ':' if (UseCapturedNS_ and self.UserAttribute_nsprefix_) else '' |
|
11719 | UserAttribute_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='UserAttribute', pretty_print=pretty_print) |
|
11720 | def to_etree(self, parent_element=None, name_='UserDefinedType', mapping_=None, reverse_mapping_=None, nsmap_=None): |
|
11721 | if parent_element is None: |
|
11722 | element = etree_.Element('{http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15}' + name_, nsmap=nsmap_) |
|
11723 | else: |
|
11724 | element = etree_.SubElement(parent_element, '{http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15}' + name_, nsmap=nsmap_) |
|
11725 | for UserAttribute_ in self.UserAttribute: |
|
11726 | UserAttribute_.to_etree(element, name_='UserAttribute', mapping_=mapping_, reverse_mapping_=reverse_mapping_, nsmap_=nsmap_) |
|
11727 | if mapping_ is not None: |
|
11728 | mapping_[id(self)] = element |
|
11729 | if reverse_mapping_ is not None: |
|
11730 | reverse_mapping_[element] = self |
|
11731 | return element |
|
11732 | def build(self, node, gds_collector_=None): |
|
11733 | self.gds_collector_ = gds_collector_ |
|
11734 | if SaveElementTreeNode: |
|
11735 | self.gds_elementtree_node_ = node |
|
11736 | already_processed = set() |
|
11737 | self.ns_prefix_ = node.prefix |
|
11738 | self._buildAttributes(node, node.attrib, already_processed) |
|
11739 | for child in node: |
|
11740 | nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] |
|
11741 | self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) |
|
11742 | return self |
|
11743 | def _buildAttributes(self, node, attrs, already_processed): |
|
11744 | pass |
|
11745 | def _buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None): |
|
11746 | if nodeName_ == 'UserAttribute': |
|
11747 | obj_ = UserAttributeType.factory(parent_object_=self) |
|
11748 | obj_.build(child_, gds_collector_=gds_collector_) |
|
11749 | self.UserAttribute.append(obj_) |
|
11750 | obj_.original_tagname_ = 'UserAttribute' |
|
11751 | def __hash__(self): |
|
11752 | return hash(self.id) |
|
11753 | # end class UserDefinedType |
|
11754 | ||
11755 |