(CommandCollection, elem, src, srcXML)
| 447 | |
| 448 | |
| 449 | def XML_ExpandTree(CommandCollection, elem, src, srcXML): |
| 450 | # unpack template 'COPY'/'CUT' command in children |
| 451 | res = False |
| 452 | while True: |
| 453 | if list(elem)==[]: # no sub-elements, stop recursion |
| 454 | break |
| 455 | |
| 456 | for child in elem: |
| 457 | res = XML_ExpandNode(CommandCollection, elem, child, src, srcXML, 'TEXT') |
| 458 | if res==True: # tree modified: restart from 1st elem |
| 459 | break # "for child" |
| 460 | |
| 461 | # recurse into children |
| 462 | XML_ExpandTree(CommandCollection, child, src, srcXML) |
| 463 | |
| 464 | res = XML_ExpandNode(CommandCollection, elem, child, src, srcXML, 'TAIL') |
| 465 | if res==True: # tree modified: restart from 1st elem |
| 466 | break # "for child" |
| 467 | |
| 468 | if res==False: # complete tree parsed with no change, stop recursion |
| 469 | break # "while True" |
| 470 | |
| 471 | |
| 472 |
no test coverage detected