On 6/5/2024 2:16 PM, Henning Hraban Ramm wrote:
Am 05.06.24 um 12:00 schrieb Christoph Edenhauser:
My Question is, is it possible to generate a second context file2.tex with the help of this first xml-mapping file1.tex, where all the xml-nodes from the xml file are mapped to contex commands
Hi, I don’t find it hard to understand, but I don’t think it’s possible within ConTeXt (while Hans keeps surprising me).
well, as one needs to do some work one can as well do this:
% oeps.tex
\startbuffer[test] <something> <what> test </what> </something> \stopbuffer
\startxmlsetups xml:mysetups \xmlsetsetup{\xmldocument}{*}{xml:*} \stopxmlsetups
\xmlregistersetup{xml:mysetups}
\startxmlsetups xml:something \tex{StartSomething}\par \xmlflush{#1}\par \tex{StopSomething}\par \stopxmlsetups
\startxmlsetups xml:what \tex{StartWhat}\par \xmlflush{#1}\par \tex{StopWhat}\par \stopxmlsetups
\setuppapersize[A1] \setupbodyfont[dejavu,ss,1pt] \setuplayout[tight] \setupalign[verytolerant,flushleft,nothyphenated]
\starttext \xmlprocessbuffer{main}{test}{} \stoptext
and then run
context oeps mutool draw -F txt oeps.pdf
and get
\StartSomething \StartWhat test \StopWhat \StopSomething
so now you need to wikify it ...
Hans
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------