Get whether the element has no children. @param content: Test content (children & text) only. @type content: boolean @return: True when element has not children. @rtype: boolean
(self, content=True)
| 676 | return self |
| 677 | |
| 678 | def isempty(self, content=True): |
| 679 | """ |
| 680 | Get whether the element has no children. |
| 681 | @param content: Test content (children & text) only. |
| 682 | @type content: boolean |
| 683 | @return: True when element has not children. |
| 684 | @rtype: boolean |
| 685 | """ |
| 686 | noattrs = not len(self.attributes) |
| 687 | nochildren = not len(self.children) |
| 688 | notext = self.text is None |
| 689 | nocontent = nochildren and notext |
| 690 | if content: |
| 691 | return nocontent |
| 692 | else: |
| 693 | return nocontent and noattrs |
| 694 | |
| 695 | def isnil(self): |
| 696 | """ |