v147 · XML · SVG

SVG from DOMParser

Chrome 147 removes inline XSLT for SVG production. The recommended replacement is DOMParser.parseFromString(svg, 'image/svg+xml') or a direct innerHTML assignment. This live editor lets you write SVG markup and see it rendered instantly via DOMParser — no XSLT required.

Live SVG editor

SVG markup

Rendered output

old XSLT approach vs new DOMParser

// OLD: inline XSLT to produce SVG (removed in Chrome 147)
// <?xml-stylesheet type="text/xsl" href="transform.xsl"?>
// This no longer works for SVG production

// NEW option 1: DOMParser (Chrome 147+, works everywhere)
const parser = new DOMParser();
const doc = parser.parseFromString(svgMarkup, 'image/svg+xml');
const svgEl = doc.documentElement;
document.body.appendChild(svgEl);

// NEW option 2: innerHTML (works for trusted content)
container.innerHTML = svgMarkup;

// NEW option 3: fetch + text response
const resp = await fetch('/icon.svg');
const svgText = await resp.text();
el.innerHTML = svgText;

references

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗