()
| 15 | |
| 16 | |
| 17 | def main(): |
| 18 | FILENAME = 'sample.xml' |
| 19 | |
| 20 | # Parse input file |
| 21 | stix_package = STIXPackage.from_xml(FILENAME) |
| 22 | |
| 23 | # Convert STIXPackage to a Python dictionary via the to_dict() method. |
| 24 | stix_dict = stix_package.to_dict() |
| 25 | |
| 26 | # Print the dictionary! |
| 27 | pprint(stix_dict) |
| 28 | |
| 29 | # Convert the first STIXPackage dictionary into another STIXPackage via |
| 30 | # the from_dict() method. |
| 31 | stix_package_two = STIXPackage.from_dict(stix_dict) |
| 32 | |
| 33 | # Serialize the new STIXPackage object to XML |
| 34 | xml = stix_package_two.to_xml() |
| 35 | |
| 36 | # Print the XML! |
| 37 | print(xml) |
| 38 | |
| 39 | if __name__ == '__main__': |
| 40 | main() |
no test coverage detected