MCPcopy Create free account
hub / github.com/JSBSim-Team/jsbsim / CheckXMLFile

Function CheckXMLFile

doc/python/JSBSim_nb_utils.py:73–85  ·  view source on GitHub ↗
(f, header)

Source from the content-addressed store, hash-verified

71
72
73def CheckXMLFile(f, header):
74 # Is f a file ?
75 if not os.path.isfile(f):
76 return False
77
78 # Is f an XML file ?
79 try:
80 tree = et.parse(f)
81 except et.ParseError:
82 return False
83
84 # Check the file header
85 return tree.getroot().tag.upper() == header.upper()
86
87
88def CopyAircraftDef(script_path, sandbox):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected