Dear list, I’m trying to write an environment to typeset HTML generated by pandoc with ConTeXt MkIV. One of the issues I’m experiencing is dealing with the lang attribute. The required sample: \startbuffer[demo] <doc lang="en"> <p>This is an English paragraph.</p> <p lang="de">Aber dieser Absatz ist auf Deutsch und enthält Spanisch (<span lang="es-ES">prueba</span>).</p> </doc> \stopbuffer \starttext \hsize\zeropoint \startxmlsetups xml:initialize \xmlsetsetup{#1}{p|doc|span}{xml:*} \stopxmlsetups \xmlregistersetup{xml:initialize} \startxmlsetups xml:doc \mainlanguage[\xmlatt{#1}{lang}] \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:p \begingroup\language[\xmlatt{#1}{lang}]\xmlflush{#1}\endgroup\par \stopxmlsetups \startxmlsetups xml:span \begingroup\language[\xmlatt{#1}{lang}]\xmlflush{#1}\endgroup \stopxmlsetups \xmlprocessbuffer{main}{demo}{} \stoptext The question is how to deal with the lang attribute in a single xmlsetup (at least for p and span [not all those elements might have a lang attribute, they can inherit it]). And a second question would be: how can I deal with language values in XML and ConTeXt? A \processaction command? Many thanks for your help, Pablo -- http://www.ousia.tk