> On 5 Apr 2020, at 12:27, Gerben Wierda <gerben.wie...@rna.nl> wrote:
> 
> Alternatively, I could have a step before this to turn the input XML into 
> many separate XMLs and have many ConTeXt runs. Probably that is the best way 
> to do it. Each generated XML would have all of the original XML except it 
> would only have one ‘view’ in it and the rest removed.

Or you could write out a shell script while processing the run. 

function moduledata.archimate(filename)
  local root = xml.load(filename)
  warnIfVerbose( "Processing %s", filename)
  local shfile = io.open(tex.jobname.. ".sh", "w")
  local i = 1
  for view in xml.collected(root,"diagrams/view") do
    local viewName = xml.text(view,"/name")
    shfile:write(string.format('mutool merge -o "%s.pdf" %s "%s.pdf" ', 
viewName, i, tex.jobname))
    i = i + 1
    ….
  end
  shfile:close()

and process that shell script at the end of the run.


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

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