[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [Suggest] jsonPath for Lua table.
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 17 Nov 2016 14:30:22 +0200
On Wed, Nov 16, 2016 at 2:32 PM, Xavier Wang <weasley.wx@gmail.com> wrote:
> local result = table.match(sheetData,
> [[ $[?(@.tag=="row")][?(@.tag=="c")] ]])
> ```
I did something like this in Penlight [1], just go down to 'Extracting
Data using Templates'
t = [[
<weather>
<current_conditions>
<condition data='$condition'/>
<temp_c data='$temp'/>
</current_conditions>
</weather>
]]
local res, ret = google:match(t)
pretty.dump(res)
And the output is:
{
condition = "Clear",
temp = "24"
}
1) http://stevedonovan.github.io/Penlight/api/manual/06-data.md.html#XML