- Documentation
- Shared functions
- xmlLoadString
Function
xmlLoadString
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
xmlLoadFileLoads an XML file and returns its root node, from which you can read children and attributes. On the server the path is relative to the resource folder (you cannot leave it). On the client it reads the script's own files and then<file>files sent by the server; a":other/file.xml"path points to another resource's file. RememberxmlUnloadFilewhen the document is no longer needed.xmlUnloadFileFrees a document from memory. All its nodes become invalid. Unsaved changes are lost.