XmlNodeGetName: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Do not forget xmlUnloadFile.)
m (Moved Example header to upper layer)
 
Line 14: Line 14:
Returns the tag name of the node if successful, ''false'' otherwise.
Returns the tag name of the node if successful, ''false'' otherwise.


==Example==
<section name="Example 1" class="both" show="true">
<section name="Example 1" class="both" show="true">
==Example==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local xml = xmlCreateFile("test.xml","test")
local xml = xmlCreateFile("test.xml","test")

Latest revision as of 19:40, 12 February 2021

Gets the tag name of the specified XML node.

Syntax

string xmlNodeGetName ( xmlnode node )

OOP Syntax Help! I don't understand this!

Method: xmlnode:getName(...)
Variable: .name
Counterpart: xmlNodeSetName


Required Arguments

  • node: the node to get the tag name of.

Returns

Returns the tag name of the node if successful, false otherwise.

Example

Click to collapse [-]
Example 1
local xml = xmlCreateFile("test.xml","test")
local xmlNode = xmlCreateChild(xml,"nextTest")
local xmlNodeName = xmlNodeGetName(xmlNode)
xmlUnloadFile(xml)
outputConsole(xmlNodeName) --This should output "nextTest".

See Also