Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • VERY interesting. So it's not XSLT, and not JS as well (I disabled JS in browser to test my code) So I guess it's a thing that browsers do? And there is no workaround but to ask backend guys to change nodename to something like "picture" instead of "image" ? Commented Apr 3 at 10:34
  • Treat/parse XML as XML, don't parse it as HTML or stuff it into an HTML DOM. Commented Apr 3 at 10:55
  • I suppose. Is there any other way to expose XML file that only exists within XSLT framework to javascript on the webpage it generates otherwise? Commented Apr 3 at 11:06
  • It is possible to stuff XSLT/XML source code into an HTML <script type="application/xml"><object><image></image></object></script> element and read out the source XML/XSLT from the script element's .text property. That way to XML/XSLT source code is untouched/preserved. Commented Apr 3 at 11:13
  • My man this is EXACTLY what I was looking for. It is perfect! This should be the answer Commented Apr 3 at 11:33