![](https://secure.gravatar.com/avatar/5955e8e90611e77ccbfc7721b6112027.jpg?s=120&d=mm&r=g)
Dear list, I have the following sample: \startbuffer[demo] <doc> <pre class="sourceCode tex typeset-fullwidth"> <code class="sourceCode latex"> \setupexternalfigures[location=default] \starttext \startTEXpage[offset=1ex] Full–width: \externalfigure[cow] \stopTEXpage \stoptext </code> </pre> <pre class="sourceCode tex typeset"> <code class="sourceCode latex"> \setupexternalfigures[location=default] \starttext \startTEXpage[offset=1ex] Half–width: \externalfigure[cow] \stopTEXpage \stoptext </code> </pre> </doc> \stopbuffer \startxmlsetups xml:initialize \xmlsetsetup{#1}{doc}{xml:*} \xmlsetsetup{\xmldocument} {pre[contains(@class,'typeset')]/code} {xml:pre:code} \stopxmlsetups \xmlregistersetup{xml:initialize} \startxmlsetups xml:doc \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:pre:code \xmlinfo{#1} \xmltobuffertextonly{#1}{.}{whereever} \xmldoifelseempty{#1}{../pre[contains(@class,'fullwidth')]} {\startalign[center]\dontleavehmode\typesetbuffer[whereever][width=.5\textwidth]\stopalign} {\startalign[center]\dontleavehmode\typesetbuffer[whereever][width=\textwidth]\stopalign} \stopxmlsetups \starttext \xmlprocessbuffer{main}{demo}{} \stoptext How can I get in xml:pre:code that the presence or absence of {../pre[contains(@class,'fullwidth')]} may trigger a conditional?
From what I understand from xml-mkiv.pdf, \xmldoifelseempty would be the right command, but I cannot make it work.
Many thanks for your help, Pablo -- http://www.ousia.tk