Get a string representation of this XML fragment. @return: A I{plain} string. @rtype: basestring
(self)
| 770 | return result |
| 771 | |
| 772 | def plain(self): |
| 773 | """ |
| 774 | Get a string representation of this XML fragment. |
| 775 | @return: A I{plain} string. |
| 776 | @rtype: basestring |
| 777 | """ |
| 778 | result = [] |
| 779 | result.append('<%s' % self.qname()) |
| 780 | result.append(self.nsdeclarations()) |
| 781 | for a in [unicode(a) for a in self.attributes]: |
| 782 | result.append(' %s' % a) |
| 783 | if self.isempty(): |
| 784 | result.append('/>') |
| 785 | return ''.join(result) |
| 786 | result.append('>') |
| 787 | if self.hasText(): |
| 788 | result.append(self.text.escape()) |
| 789 | for c in self.children: |
| 790 | result.append(c.plain()) |
| 791 | result.append('</%s>' % self.qname()) |
| 792 | result = ''.join(result) |
| 793 | return result |
| 794 | |
| 795 | def nsdeclarations(self): |
| 796 | """ |