[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Parsing XML
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 8 Aug 2016 16:20:24 -0300
> How can I access the document via element names instead?
Get my lxml at
http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/index.html#lxml
Replace the dump function in test.lua by the code below.
It seemed to work for me. Adapt as needed.
local interest={
["vuln:cve-id"]=true,
["cvss:score"]=true,
["cpe-lang:fact-ref"]=true,
}
local function dump(t)
for k,v in pairs(t) do
if interest[k] then print(k,v) end
end
for k,v in ipairs(t) do
if type(v)=="table" then
dump(v)
end
end
end