Hi, 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
output.
When I process the included files with
context --environment=prozess-style-ecm.tex prozess.xml
I get
[ctxlua]:19: table index is nil
12
13 doc = xml.load(doclistfile, settings)
14
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 =
(cropstring(xml.filter(v,"/docverantwortlich/text()")))
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
HD/usr/local/texlive/context-109/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2020.01.30 14:13
mtx-context | main context file: /Volumes/Macintosh
HD/usr/local/texlive/context-109/tex/texmf-context/tex/context/base/mkiv/context.mkxl
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
doclist.xml
Description: XML document
prozess.xml
Description: XML document
prozess-style-ecm.tex
Description: Binary data
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : [email protected] / 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 ___________________________________________________________________________________
