Brilliant, thanks Hans. Looks like I need to start delving properly into the power of the XML setups.

Duncan

On Sun, 28 Jul 2019 at 21:04, Hans Hagen <j.hagen@xs4all.nl> wrote:

\usemodule[mathml]

\startxmlsetups mml:formula
     \edef\mmlformulalabel{\xmlatt{#1}{label}}
     \edef\mmlformulatitle{\xmlatt{#1}{title}}
     \doifsomethingelse {\mmlformulalabel\mmlformulatitle} {

\startplaceformula[reference=\mmlformulalabel,title=\mmlformulatitle]
             \startformula
                 \xmlfirst{#1}{/mml:math}
             \stopformula
         \stopplaceformula
     } {
         \startformula
             \xmlfirst{#1}{/mml:math}
         \stopformula
     }
\stopxmlsetups

Duncan