2,732
edits
Red Leader (talk | contribs) (→read_airport_properties(): Finish]) |
Red Leader (talk | contribs) (→Functions: Start read_properties()) |
||
Line 209: | Line 209: | ||
=== read_properties() === | === read_properties() === | ||
Load XML file in FlightGear's native | {{Nasal doc | ||
If the second, optional target parameter is set, then the properties | |syntax = io.read_airport_properties(path[, target]); | ||
are loaded to this node in the global property tree. Otherwise they | |text = Load XML file in FlightGear's native {{tag|PropertyList}} format. If the second, optional target parameter is set, then the properties are loaded to this node in the global property tree. Otherwise they are returned as a separate props.Node tree. Returns the data as a <code>props.Node</code> on success or nil on error. | ||
are returned as a separate props.Node tree. Returns the data as a | |param1 = path | ||
props.Node on success or nil on error. | |param1text = Path to the XML file. | ||
|param2 = target | |||
|param2text = Optional place to put the results in the [[Property Tree]]. May be either a <code>props.Node</code> object or a property path. | |||
|example1 = var target = props.globals.getNode("/sim/model"); | |||
io.read_properties("/tmp/foo.xml", target); | |||
|example2 = var data = io.read_properties("/tmp/foo.xml", "/sim/model"); | |||
var data = io.read_properties("/tmp/foo.xml"); | |||
var target = props.globals.getNode("/sim/model"); | }} | ||
io.read_properties("/tmp/foo.xml", target); | |||
var data = io.read_properties("/tmp/foo.xml", "/sim/model"); | |||
var data = io.read_properties("/tmp/foo.xml"); | |||
=== readfile() === | === readfile() === |