[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Simple XML Parser for Lua?
- From: PA <petite.abeille@...>
- Date: Fri, 3 Jun 2005 15:04:08 +0200
On Jun 03, 2005, at 12:25, Premshree Pillai wrote:
Is there a simple XML parser (preferably DOM) for Lua?
XPP rather than DOM:
http://dev.alt.textdrive.com/file/lu/LUXMLInputStream.lua
Usage example:
local anInputStream = LUXMLInputStream.new( aContent )
while ( true ) do
local aType, aContent, aName, someAttributes =
anInputStream.read()
if ( aType == nil ) then
break
elseif ( aType == LUXMLInputStream.Text ) then
print( aType, aContent )
elseif ( someAttributes ~= nil ) then
print( aType, aName,
someAttributes.keys().sort().toString() )
else
print( aType, aName )
end
end
Cheers
--
PA, Onnay Equitursay
http://alt.textdrive.com/