- Dokumentacja
- Funkcje wspólne
- xmlNodeGetAttribute
Funkcja
xmlNodeGetAttribute
Zwraca wartość atrybutu węzła jako tekst (liczby trzeba zamienić przez tonumber).
Składnia
string xmlNodeGetAttribute(xmlnode node, string name)Argumenty
nodexmlnode- Węzeł.
namestring- Nazwa atrybutu.
Zwraca
Wartość albo false, gdy atrybutu nie ma.
Przykład
local root = xmlLoadString('<car model="411" price="150000"/>')
local price = tonumber(xmlNodeGetAttribute(root, "price"))
xmlUnloadFile(root)