On 8/21/2023 6:56 PM, Thomas A. Schmitz wrote:
On 8/21/23 18:36, Michael Löscher wrote:
Thank you so far. But what I would like to understand first ist how
the different setups work togehter. How are they processed? What is
the order of processing, which are the stets taken by the enginge when
processing an xml document? Without understanding how that works, it
is not possible to apply certain tests on the xml nodes.
As the manual mk.pdf, chapter XVII states: it's a mixture of streaming
parser and tree manipulation. The whole xml document is transformed into
a Lua table and then processed. But I definitely get the "do my homework
for me" vibe, so this will be all from me.
in addition:
you need a bit of imagination because basically (depends a bit on what
you do) one big nested expansion is going on, as Thomas explained: using
setups which are basically macros. The #1 is the current node (but you
can store it in a macro and use it later if needed). So, only references
are passed around.
for thomas: we now also have (in lmtx)
\ifxml {id}{pattern} \else \fi
\ifxmltext {id}{pattern} \else \fi
\ifxmlatt {id}{name}{value} \else \fi
\ifxmlattempty {id}{pattern} \else \fi
\ifxmlempty {id}{pattern} \else \fi
\ifxmlselfempty{id} \else \fi
which in some cases is more efficient
there is also \xmllastatt etc which can be used after a test which
avoids a second lookup
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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage : https://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___________________________________________________________________________________