On 8/14/25 18:57, Hans Hagen wrote:
wrt multiple setups:

you can load all kind of xml files using explicit namespaces so, not #1 but {one} {two} etc an when you then need something you just access it explicitly, so no #1 but {two} ; you can mix and match any way you like

the #1 approach is just a generic one

when your main one is {main} you can also use that anywhere, so in the middle of some setup (say one that does a chapter title) you can just access something {main} which is then the root of the same document

And just to be on the safe side: is the following example what you're referring to? This seems to work, I may be able to use this for my real file...

All best

Thomas

\startbuffer[test]
<document>
  <p>Hello world</p>
</document>
\stopbuffer

%%% ONE

\startxmlsetups xml:firstsetups
        \xmlsetsetup{one}{document|p}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:firstsetups}

\startxmlsetups xml:document
        \xmlflush {#1}
\stopxmlsetups

\startxmlsetups xml:p
        \color [blue] {\xmlflush{#1}}\par
\stopxmlsetups

%%% TWO

\startxmlsetups my:secondsetups
        \xmlsetsetup{two}{document|p}{my:*}
\stopxmlsetups

\xmlregistersetup{my:secondsetups}

\startxmlsetups my:document
        \xmlflush {#1}
\stopxmlsetups

\startxmlsetups my:p
        \color [red] {\xmlflush{#1}}\par
\stopxmlsetups

%%% THREE

\startxmlsetups your:yasetups
        \xmlsetsetup{three}{document|p}{your:*}
\stopxmlsetups

\xmlregistersetup{your:yasetups}

\startxmlsetups your:document
        \xmlflush {#1}
\stopxmlsetups

\startxmlsetups your:p
        \color [yellow] {\xmlflush{#1}}\par
\stopxmlsetups

\starttext

\xmlprocessbuffer{one}{test}{}
        
\xmlprocessbuffer{two}{test}{}

\xmlprocessbuffer{three}{test}{}

\stoptext

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to