When trying to store XML in variables and then render it, nothing is displayed.
Example XML string data: <?xml version="1.0" encoding="UTF-8"?>
In the script below, testvar1 is rendered, but not testvar2.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<div id="target"></div>
<script>
var testvar1 = "balls";
var testvar2 = `<?xml version="1.0" encoding="UTF-8"?>`;
document.getElementById("target").innerHTML = testvar1 + testvar2;
</script>
</body>
</html>
I can't think of a reason for this not to work. But I'm probably overlooking something that is obvious to everyone else...
yesworks. But<yes></yes>does not work. It seems all XML tags are being discarded.var testvar2 = '<?xml version="1.0" encoding="UTF-8"?>';you get the same result; the template-literal seems unrelated to the issue.