My understanding (based on the announcement about better, faster automatic identifiers) is that if a <latex-image> or <asymptote> does not have an @label, the pre-processor will create one by looking up the tree for an xml:id.
Or something like that.
But ultimately I should provide these labels myself, and that leaves me wondering if there is (or could be) some XSL utility to do it for me.
I am pretty sure that every <image> in APEX has an xml:id. Now, I would like to do exactly what the pre-processor does:
If I have
<image xml:id="foo">
<description>
<p>
Potentially a whole bunch of text over a variable number of lines,
and it may not be present yet depending on how far into the book we are...
</p>
</description>
<shortdescription>100 very descriptive characters or fewer</shortdescription>
<latex-image>
... and all that follows...
I would like to grab the xml:id="foo" from the image element, and write a label="foo" into the latex-iamge element.
I *might* be able to do this with regex in VSCode, but I'm not confident I'll get everything, and I suspect that XSL would be a better tool for the job in any case.
Do we have a tool for this? If not, would it be hard (for me, not Rob) to make one?