XML: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(added a link to the CDU, which also uses XML)
mNo edit summary
Line 1: Line 1:
{{stub}}
{{stub}}
'''XML''' or '''Extensible Markup Language (XML)''', is basically a specification for writing formats used by other software programs. It is used in [[FlightGear]] for many things, and the files can be edited in plain text.
'''XML''' or '''Extensible Markup Language (XML)''', is basically a specification for writing formats used by other software programs.  
It is used in [[FlightGear]] for many things, and the files can be edited in plain text.  


Examples include [[joystick]] or [[CDU]] configuration files, and [[Nasal]]
Most XML files in FlightGear are based on the so called "PropertyList" format and follow the corresponding structure: [[PropertyList XML File]].
PropertyList encoded XML files map nested XML tags to FlightGear properties and only use a well-defined subset of XML.
 
<position>
  <altitude-ft>10000</altitude-ft>
  <latitude-deg>-117.00</latitude-deg>
  <longitude-deg>35</longitude-deg>
</position>
 
This markup specifies three "child" properties named "altitude-ft", "latitude-deg" and "longitude-deg". These are all children of the "position" group.
 
In FlightGear, these nested tags would then map to properties like this:
 
* /position/altitude-ft
* /position/latitude-deg
* /position/longitude-deg
 
This can be imagined like a directory structure, with "position" being a toplevel directory and the three child nodes being child nodes (sub directories or files).
 
Examples include [[joystick]] or [[CDU]] configuration files.
 
PropertyList-encoded XML files can be easily processed directly by FlightGear, by both, core C++ source code, as well as Nasal scripts.
In addition, it is easily possible to include other PropertyList-encoded XML files by using the include attribute for a tag:
 
<colors include="colors.xml"/>


=Links=
=Links=

Revision as of 23:12, 29 November 2010

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

XML or Extensible Markup Language (XML), is basically a specification for writing formats used by other software programs. It is used in FlightGear for many things, and the files can be edited in plain text.

Most XML files in FlightGear are based on the so called "PropertyList" format and follow the corresponding structure: PropertyList XML File. PropertyList encoded XML files map nested XML tags to FlightGear properties and only use a well-defined subset of XML.

<position>
 <altitude-ft>10000</altitude-ft>
 <latitude-deg>-117.00</latitude-deg>
 <longitude-deg>35</longitude-deg>
</position>

This markup specifies three "child" properties named "altitude-ft", "latitude-deg" and "longitude-deg". These are all children of the "position" group.

In FlightGear, these nested tags would then map to properties like this:

  • /position/altitude-ft
  • /position/latitude-deg
  • /position/longitude-deg

This can be imagined like a directory structure, with "position" being a toplevel directory and the three child nodes being child nodes (sub directories or files).

Examples include joystick or CDU configuration files.

PropertyList-encoded XML files can be easily processed directly by FlightGear, by both, core C++ source code, as well as Nasal scripts. In addition, it is easily possible to include other PropertyList-encoded XML files by using the include attribute for a tag:

<colors include="colors.xml"/>

Links

Related