MCPcopy Create free account
hub / github.com/STIXProject/python-stix / parseString

Function parseString

stix/bindings/report.py:847–862  ·  view source on GitHub ↗
(inString)

Source from the content-addressed store, hash-verified

845
846
847def parseString(inString):
848 from mixbox.vendor.six import StringIO
849 doc = parsexml_(StringIO(inString))
850 rootNode = doc.getroot()
851 rootTag, rootClass = get_root_tag(rootNode)
852 if rootClass is None:
853 rootTag = 'Report'
854 rootClass = ReportType
855 rootObj = rootClass.factory()
856 rootObj.build(rootNode)
857 # # Enable Python to collect the space used by the DOM.
858 # doc = None
859 # sys.stdout.write('<?xml version="1.0" ?>\n')
860 # rootObj.export(sys.stdout, 0, name_="Report",
861 # namespacedef_='')
862 return rootObj

Callers

nothing calls this directly

Calls 3

get_root_tagFunction · 0.70
factoryMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected