function memoannouncement(tPlayer)
xml = xmlLoadFile ( ":CGlogin/announcements.xml" )
if (xml ~= false) then --If loading the file wasn't failed, then:
children = xmlNodeGetChildren(xml)
for placeNumber, childrenData in ipairs(children) do --Loop through all childs in the XML file.
attr = xmlNodeGetAttributes(childrenData) --Get all attributes with values
for attributeData, valueData in pairs(attr) do --For every attribute, do:
outputChatBox(attributeData..": "..valueData, tPlayer)
end
end
else
outputChatBox("Error loading announcements files", tPlayer)
end
end
addCommandHandler("testmemo", memoannouncement)
'xmlNodeGetAttributes' returns a table of arrays/keys(?). Also this needs to be looped through with 'pairs' and not with 'ipairs'. 'xmlNodeGetChildren' needs to be looped though with 'ipairs', because this code returns a table with indexes.
I think you are using this server-side, otherwise, remove ", tPlayer".
Made this 'start' for you, now you can make your script further from here.
--
XML doesn't 'support' those signs