Hello Massi, thanks for you help.
Am 10.03.2020 um 20:53 schrieb mf
: In your tex file, try this:
\startluacode settings = {} docstruktur = {} doclistfile = "doclist.xml"
local striplines = utilities.strings.striplines
cropstring = function(s) -- return striplines(s, "prune and collapse") return striplines(s) end
Well, with this definition I can actually inline that.
local xmltext = xml.text
doc = xml.load(doclistfile, settings)
for v in xml.collected(doc,"/doclist/psdoc/") do -- print (v) -- print (xml.text(v,"/docnr")) local docnr = cropstring(xml.text(v,"/docnr")) print (docnr) local docname = cropstring(xmltext(v,"/docname")) -- es kann mehrere DOCAN geben! local docan = (cropstring(xmltext(v,"/docan"))) local docverantwortlich = (cropstring(xmltext(v,"/docverantwortlich")))
docstruktur[docnr]={ docname = docname, docan = docan, docverantwortlich = docverantwortlich }
Great, that is even shorter.
end \stopluacode
I’m cleaning up my backend code to make it more Lua like. Greetings Axel