Skip to content

Examples: content parsing for cybox v2.0

ikiril01 edited this page Apr 23, 2013 · 2 revisions

The following example demonstrates how to parse an input CybOX XML file (in this case the file generated by the simple content creation example), and for the purpose of this example, print out the number of Observables in the document.

#CybOX Parsing Example
import cybox.bindings.cybox_core as cybox_core_binding

#Parse the input CybOX XML file
observables = cybox_core_binding.parse('watchlist_example.xml')
#Print out the number of Observables in the document
print 'Number of Observables: ' + str(len(observables.get_Observable()))