Including SVG inline in html5 output?
Posted: Mon Nov 16, 2020 12:06 pm
In DITA topics, I want to refer to diagrams that are stored in external SVG files.
When I use DITA-OT to transform those DITA topics into HTML5, I want the contents of those SVG files to be inline in the HTML, as opposed to being referred to by HTML img elements.
For example, rather than using the DITA image element, resulting in an img element in the HTML output, I want to use, say, the DITA svg-container element with an svgref child element, resulting an svg element in the HTML output
Given time, I could probably write the XSLT myself to do this: that is, to replace that combination of DITA elements in the source with the contents of the SVG file in the output.
However, it seems to me that this is a common use case. I strongly suspect I'm missing something. (How) can I do this with out-of-the-box latest DITA OT?
(Aside: is there a way to markup inline phrases - for example, XML element names, preferably with enclosing brackets - in this forum, so that they are rendered in monospaced font?)
When I use DITA-OT to transform those DITA topics into HTML5, I want the contents of those SVG files to be inline in the HTML, as opposed to being referred to by HTML img elements.
For example, rather than using the DITA image element, resulting in an img element in the HTML output, I want to use, say, the DITA svg-container element with an svgref child element, resulting an svg element in the HTML output
Given time, I could probably write the XSLT myself to do this: that is, to replace that combination of DITA elements in the source with the contents of the SVG file in the output.
However, it seems to me that this is a common use case. I strongly suspect I'm missing something. (How) can I do this with out-of-the-box latest DITA OT?
(Aside: is there a way to markup inline phrases - for example, XML element names, preferably with enclosing brackets - in this forum, so that they are rendered in monospaced font?)