Writes the internal representation of the XmlTree to the given file name Returns False on error @rtype: boolean @return: True on success, otherwise False
(self, filename)
| 233 | return False |
| 234 | |
| 235 | def writeToFile(self, filename): |
| 236 | """ |
| 237 | Writes the internal representation of the XmlTree to the given file name |
| 238 | Returns False on error |
| 239 | |
| 240 | @rtype: boolean |
| 241 | @return: True on success, otherwise False |
| 242 | """ |
| 243 | try: |
| 244 | if not filename: |
| 245 | return False |
| 246 | if not self.tree: |
| 247 | return False |
| 248 | |
| 249 | ### TODO: Add all necessary namespaces |
| 250 | self.tree.write(filename, "UTF-8", True, OvalDocument.NS_DEFAULT, "xml") |
| 251 | |
| 252 | except Exception: |
| 253 | return False |
| 254 | |
| 255 | def to_string(self): |
| 256 | if not self.tree: |