This works:
local metadata = xml.filter (t, '../../topics/topic[@t:id=="' .. ch_id
.. '"]')
also this:
local lpath = string.format('../../topics/topic[@t:id=="%s"]', ch_id)
local metadata = xml.filter (t, lpath)
It looks like xml.filter supports only 2 arguments (see lxml-tex.lua),
and so it doesn't let you use string formatting patterns like the
"context" command does.
You can write:
context('the value of @t:id is "%s"', ch_id)
but you can't write:
xml.filter (t, '../../topics/topic[@t:id=="%s"]', ch_id)
Best wishes,
Massi
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage : https://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___________________________________________________________________________________