lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> 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