Uptooda Scripting API
Loading...
Searching...
No Matches
SimpleXmlNode Class Reference

#include <SimpleXml.h>

Public Member Functions

string Attribute (string name) const
bool AttributeBool (string name) const
int AttributeInt (string name) const
SimpleXmlNode CreateChild (string name)
void DeleteChilds ()
SimpleXmlNode  Each (function callback)
int GetAttributeCount ()
SimpleXmlNode GetChild (string name, bool create=true)
SimpleXmlNode GetChildByIndex (int index)
int GetChildCount ()
array GetChilds (string name)
bool IsNull () const
string Name () const
void SetAttribute (string name, string value)
void SetAttribute (string name, int value)
void SetAttribute (string name, int value)
void SetAttributeBool (string name, bool value)
void SetAttributeInt (string name, int value)
void SetAttributeString (string name, string value)
void SetText (string value)
string Text () const

Detailed Description

Member Function Documentation

◆ Each()

SimpleXmlNode Each ( function callback)

Iterate over childs

Since
1.3.2

Example:

local xml = SimpleXml();
xml.LoadFromFile("servers.xml");
xml.GetRoot("Servers", false).each(function(i,el) {
if ( el.Name() == "Server" ) {
print(el.Attribute("Name") + "\r\n");
}
});

◆ GetChildByIndex()

SimpleXmlNode GetChildByIndex ( int index)

Slow function (it iterates over children)

Deprecated
since 1.4.1

◆ GetChildCount()

int GetChildCount ( )

Slow function (it iterates over children)

◆ GetChilds()

array GetChilds ( string name)

Get children by tag name

Since
1.3.2

Example:

local xml = SimpleXml();
xml.LoadFromFile("servers.xml");
local childs = xml.GetRoot("Servers", false).GetChildren("Server");
foreach (i,el in childs) {
print(el.Attribute("Name") + "\r\n");
}