Subelement factory which creates an element instance, and appends it to an existing parent. The element tag, attribute names, and attribute values can be either bytes or Unicode strings. *parent* is the parent element, *tag* is the subelements name, *attrib* is an optional dire
(parent, tag, /, attrib={}, **extra)
| 417 | |
| 418 | |
| 419 | def SubElement(parent, tag, /, attrib={}, **extra): |
| 420 | """Subelement factory which creates an element instance, and appends it |
| 421 | to an existing parent. |
| 422 | |
| 423 | The element tag, attribute names, and attribute values can be either |
| 424 | bytes or Unicode strings. |
| 425 | |
| 426 | *parent* is the parent element, *tag* is the subelements name, *attrib* is |
| 427 | an optional directory containing element attributes, *extra* are |
| 428 | additional attributes given as keyword arguments. |
| 429 | |
| 430 | """ |
| 431 | attrib = {**attrib, **extra} |
| 432 | element = parent.makeelement(tag, attrib) |
| 433 | parent.append(element) |
| 434 | return element |
| 435 | |
| 436 | |
| 437 | def Comment(text=None): |
nothing calls this directly
no test coverage detected
searching dependent graphs…