PropertyList XML files: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(encoding="UTF-8")
m (Link to special directory articles)
Line 4: Line 4:
This page is meant is introduce new FlightGear users to the PropertyList XML file format, this is basically an XML based file format specifically created for use by the FlightGear [[Property Tree Intro|Property Tree]].
This page is meant is introduce new FlightGear users to the PropertyList XML file format, this is basically an XML based file format specifically created for use by the FlightGear [[Property Tree Intro|Property Tree]].


For additional background information, you'll also want to refer to $FG_ROOT/Docs/README.introduction.
For additional background information, you'll also want to refer to [[$FG_ROOT]]/Docs/README.introduction.


Most configuration files in FlightGear are XML-encoded* property lists.
Most configuration files in FlightGear are XML-encoded* property lists.
Line 63: Line 63:
</syntaxhighlight>
</syntaxhighlight>


For further information please refer to $FG_ROOT/Docs/README.introduction and
For further information please refer to [[$FG_ROOT]]/Docs/README.introduction and





Revision as of 10:30, 21 March 2013

This article is a stub. You can help the wiki by expanding it.

This page is meant is introduce new FlightGear users to the PropertyList XML file format, this is basically an XML based file format specifically created for use by the FlightGear Property Tree.

For additional background information, you'll also want to refer to $FG_ROOT/Docs/README.introduction.

Most configuration files in FlightGear are XML-encoded* property lists. The root element of each file is always named <PropertyList>. Tags are almost always found in pairs, with the closing tag having a slash prefixing the tag name, i.e </PropertyList>. The exception is the tag representing an aliased property. In this case a slash is prepended to the closing angle bracket.

A minimal example of a complete property list encoded XML file, looks like this:

 <?xml version="1.0" encoding="UTF-8"?>
 <PropertyList>
  
 </PropertyList>

Property typing is optional, all properties are by default string/unspecified and are transparently converted by the property tree:

 <?xml version="1.0" encoding="UTF-8"?>
 <PropertyList>
  <foo type="string">Hello</foo>
  <pi type="float">3.14</pi>
  <boo type="bool">true</boo>
 </PropertyList>

Indexing happens implicitly for identically named properties:

 <?xml version="1.0" encoding="UTF-8"?>
 <PropertyList>
  <foo>Hello</foo> 
  <foo>Hello</foo>
  <foo>Hello</foo>
 </PropertyList>

so that the three foo tags become foo[0], foo[1], foo[2] in the property tree.


Indexing happens implicitly for identically named properties:

 <?xml version="1.0" encoding="UTF-8"?>
 <PropertyList>
  <foo n="0">Hello</foo> 
  <foo n="1">Hello</foo>
  <foo n="2">Hello</foo>
 </PropertyList>

To make property settings persistent in between FlightGear sessions, use the userarchive attribute:

 <?xml version="1.0" encoding="UTF-8"?>
 <PropertyList>
  <foo userarchive="y">Hello</foo> 
 </PropertyList>

For further information please refer to $FG_ROOT/Docs/README.introduction and