I have XML document that was parsed to DOM object like this:
const contentDoc = new DOMParser().parseFromString(data, "text/xml");
How can I add/prepend following xml-stylesheet directive to it?
<?xml-stylesheet type="text/xsl" href="style.xsl"?>
I want to visualize provided XML file using XSLT stylesheet (that is also provided for me) and I do not want to play with strings (I could potentially just add this declaration with simple string operations before the XML becomes DOM) but I would like to do this properly.