Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 336d0adfad
Fetching contributors…

Cannot retrieve contributors at this time

file 16 lines (14 sloc) 0.455 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
require('LuaXml')

-- load XML data from file "test.xml" into local table xfile
local xfile = xml.load("test.xml")
-- search for substatement having the tag "scene"
local xscene = xfile:find("scene")
-- if this substatement is found…
if xscene ~= nil then
  -- …print it to screen
  print(xscene)
  -- print tag, attribute id and first substatement
  print( xscene:tag(), xscene.id, xscene[1] )
end

xfile:save"t.xml"
print("---\nREADY.")
Something went wrong with that request. Please try again.