xml.load(file)function

Loads and parses an XML file, returning the root Node object representing the XML structure.

Parameters

file

A File object or a filename string representing the XML file to load.

Return value

Returns a Node object representing the root of the XML tree, or nil in case of error.

Example

--! luart-extensions import xml -- Load an XML file local root = xml.load("example.xml") -- Print the root node name print(root.name)