16 Nov
2022
16 Nov
'22
7:56 p.m.
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