GetRootElement

From Multi Theft Auto: Wiki
Revision as of 13:31, 20 May 2006 by EAi (talk | contribs)
Jump to navigation Jump to search

This function returns the root node for the element tree, called map. This represents the map node at the root of the XML document that contains map data.

This is a special element that is consistent across map changes. It is never destroyed and cannot be destroyed using destroyElement. It contains directly, or indirectly every other element in the map.

Syntax

element getRootElement ()

Returns

Returns the root element object.

Example

This example will retrieve the version of the currently loaded map, by reading the version argument from the root element of the element tree.

root = getRootElement ()
version = getElementData ( root, "version" )

Template:Element Functions