File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -181,16 +181,26 @@ def read(self) -> MessageImplementationGuide:
181
181
read the entire file and convert it to a MessageImplementationGuid instance
182
182
"""
183
183
segments_and_groups = []
184
+ root_gathering = []
184
185
root = self ._element_tree .getroot ()
185
186
if _is_uebertragungsdatei (root ):
186
187
for elem in root .iter ():
188
+ if elem .tag .startswith ("S_UNA" ) | elem .tag .startswith ("S_UNB" ):
189
+ root_gathering .append (elem )
187
190
if elem .tag .startswith ("M_" ):
188
- root = elem
191
+ root_gathering . append ( elem )
189
192
break
190
- for index , element in enumerate (root ):
191
- if index == 0 :
193
+ for sinlge_root in root_gathering :
194
+ if sinlge_root .tag .startswith ("M_" ):
195
+ for index , element in enumerate (sinlge_root ):
196
+ if index == 0 :
197
+ if not element .tag .startswith ("S_UNH" ):
198
+ continue
199
+ segments_and_groups .extend (self ._iter_segments_and_segment_groups (element ))
200
+ if sinlge_root .tag .startswith ("S_UNA" ) | sinlge_root .tag .startswith ("S_UNB" ):
201
+ segments_and_groups .extend (self ._iter_segments_and_segment_groups (sinlge_root ))
202
+ else :
192
203
continue
193
- segments_and_groups .extend (self ._iter_segments_and_segment_groups (element ))
194
204
195
205
result = MessageImplementationGuide (
196
206
veroeffentlichungsdatum = self .get_publishing_date (),
You can’t perform that action at this time.
0 commit comments