Encode (escape) special XML characters. @return: The text with XML special characters escaped. @rtype: L{Text}
(self)
| 47 | return result |
| 48 | |
| 49 | def escape(self): |
| 50 | """ |
| 51 | Encode (escape) special XML characters. |
| 52 | @return: The text with XML special characters escaped. |
| 53 | @rtype: L{Text} |
| 54 | """ |
| 55 | if not self.escaped: |
| 56 | post = sax.encoder.encode(self) |
| 57 | escaped = post != self |
| 58 | return Text(post, lang=self.lang, escaped=escaped) |
| 59 | return self |
| 60 | |
| 61 | def unescape(self): |
| 62 | """ |