On Fri, 3 Jun 2011, Thomas A. Schmitz wrote:
Hi all,
I'm pulling my hair - thought this was easy, but turns out to be more difficult. The \externalfigure command can take a width and/or a height parameter, and context will be happy to take either one into account. I'm trying to translate that into xml syntax. Here's a minimal example that I can't make work. If anyone can explain what to do here, I might be able to work this out (or will be back with more questions :-)
\startbuffer[test] <a> <externalfigure height="1cm" resource="hacker"/> </a> \stopbuffer
\startxmlsetups xml:testsetups \xmlsetsetup{\xmldocument}{a|externalfigure}{xml:*} \stopxmlsetups
\xmlregistersetup{xml:testsetups}
\startxmlsetups xml:a \xmlflush{#1}\par \stopxmlsetups
\startxmlsetups xml:externalfigure \externalfigure[\xmlatt{#1}{resource}] [\doifnotempty{\xmlatt{#1}{height}}{height=\xmlatt{#1}{height}}] \stopxmlsetups
(untested) \exeternalfigure[...][height=\doifemptyelse{\xmlatt{#1}{height}}{fit}{\xmlatt{#1}{height}}] Aditya