after one year I’m back at a project processing XML with ConTeXt.

Here is what I want to do:
I have an XML file that I want to format with ConTeXt.
I got this working last year.

Now I want to take some information from a second file.

My idea is to read the second file, store the data into a table and 
write auxiliary functions to access the data and insert them into the TeX 

When I process the included files with

context --environment=prozess-style-ecm.tex prozess.xml

I get

[ctxlua]:19: table index is nil

13     doc = xml.load(doclistfile, settings)
15     for v in xml.collected(doc,"/doclist/psdoc/") do
16      -- print ((xml.filter(v,"//docnr/stripped()")))
17      docnr = (cropstring(xml.filter(v,"/docnr/text()")))
18      docname = (cropstring(xml.filter(v,"/docname/text()")))
19      -- es kann mehrere DOCAN geben!
20      docan = (cropstring(xml.filter(v,"/docan/text()")))
21      docverantwortlich = 
22 >>   docstruktur[docnr]={}

The xml.collected works, but the xml.filter returns nil.

What did I miss?

mtx-context     | ConTeXt Process Management 1.03
mtx-context     |
mtx-context     | main context file: /Volumes/Macintosh 
mtx-context     | current version: 2020.01.30 14:13
mtx-context     | main context file: /Volumes/Macintosh 
mtx-context     | current version: 2020.01.30 14:13

The same code works when I use it in a Lua file that I call with

mtxrun --script panalyse.lua

Greetings Axel

Attachment: doclist.xml
Description: XML document

Attachment: prozess.xml
Description: XML document

Attachment: prozess-style-ecm.tex
Description: Binary data

If your question is of interest to others as well, please add an entry to the 

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net

Reply via email to