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