ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. xmlLoadString

Function

xmlLoadString

Server and clientXMLIdentical to MTA:SA

Loads an XML document directly from a string (e.g. received with fetchRemote), read-only. Returns the root node.

Syntax

xmlnode xmlLoadString(string xmlString)

Arguments

xmlStringstring
XML content.

Returns

The root node, or false for invalid XML.

Example

local root = xmlLoadString('<config><setting name="maxPlayers" value="64"/></config>')
local setting = xmlFindChild(root, "setting", 0)
outputDebugString(xmlNodeGetAttribute(setting, "value"))
xmlUnloadFile(root)

See also