On 6/17/24 16:52, Wolfgang Schuster wrote: > Hans van der Meer schrieb am 17.06.2024 um 09:01: >> I want to show an errormessage when the macro is undefined. It requires >> expansion of \xmlatt{#1}{name}.
dr. van der Meer, \xmldoifatt (with ifnot and ifelse variants) should cover that case (https://www.pragma-ade.com/general/manuals/xml-mkiv.pdf#search=xmldoifatt). But I cannot make any of these conditionals work (I‘m afraid there may be an issue with their definition). \startbuffer[ifdefined] <document> <macro name="bold" arg="text"/> <macro name="hvdm" arg="text"/> </document> \stopbuffer \startxmlsetups xml:hvdm \xmlsetsetup{#1}{*}{xml:*} \stopxmlsetups \xmlregistersetup{xml:hvdm} \startxmlsetups xml:document \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:macro \xmlatt{#1}{name}\\ \xmlatt{#1}{arg}\\ \xmldoifelseatt{#1} {name}{yes}{no}\\ \xmldoifelseatt{#1} {names}{yes}{no}\\ \stopxmlsetups \starttext \xmlprocessbuffer{hvdm}{ifdefined}{} \stoptext As a workaround \doifelsetext{\xmlatt{#1}{name}}{yes}{no} may do the trick here. I hope it helps, Pablo ___________________________________________________________________________________ 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 ___________________________________________________________________________________