I’m using an XML file to store some generated data and plots. The plots are svg images and I would like to use a XSLT to transform the XML file to an HTML with the SVG plots embedded inline. Is it possible?
<Root>
<Data ... />
<Data ... />
<Plot><svg>....</svg><Plot>
<Data ... />
</Root>
I tried with:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
...
</head>
<body>
<div><xsl:for-each select="//Data"><xsl:value-of select="Something" />...</xsl:for-each></div>
<div><xsl:for-each select="//Plot"><xsl:value-of select="." /></xsl:for-each></div>
...
I embedded the SVG plot into the XML surrounded by a and used an XSLT to get the and place the SVG content into an HTML structure.
The final result should be an HTML file that can be opened offline.
<html>
<head>
...
</head>
<body>
<div>Some data...</div>
<div><svg>... svg plot ...</svg></div>
...
New contributor
Massimo Oss Noser is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.