[NTG-context] conditional not working in \setuphead

Pablo Rodriguez oinos at gmx.es
Mon Apr 20 18:55:28 CEST 2020


Dear list,

I have the following sample:

  \startbuffer[demo]
  <doc>
    <section id="section-i1">
      <text>first</text>
    </section>
    <section id="section-i2">
      <text>second</text>
    </section>

  </doc>
  \stopbuffer

  \startxmlsetups xml:initialize
     \xmlsetsetup{#1}{doc|section}{xml:*}
  \stopxmlsetups

  \xmlregistersetup{xml:initialize}

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

  \startxmlsetups xml:section
     \startsection[title={\xmlatt{#1}{id}},
        beforesection={\doif{\xmlatt{#1}{id}}{\selectedtopic}
            {conditional}}]
        \xmlflush{#1}
        \doif{\xmlatt{#1}{id}}{\selectedtopic}{conditional}
     \stopsection
  \stopxmlsetups

  \def\selectedtopic{section-i1}

  \starttext
     \xmlprocessbuffer{main}{demo}{}
  \stoptext

How can I make the conditional in the beforesection option work?

Many thanks for your help,

Pablo
--
http://www.ousia.tk


More information about the ntg-context mailing list