System.Xml.XmlDocument.OuterXml() will generate (for example)
<list id="myBooks">
<book id="123" name="XML for muppets" />
<book id="456" name="HTML for fools" />
</list>
If you want to embed this xml into HTML page then it will work fine in IE (as xml data islands are an extension to the html standards)
However for Firefox you need to load this unknown html tag that happens to contain xml into a DOMParser using something like
var list = document.getElementById("myBooks");
var doc = new DOMParser().parseFromString(list.outerHTML);
However because <tag />
is not == <tag></tag>
in HTML firefox will see list.outerHTML as
<list>
<book id="123" name="XML for muppets">
<book id="456" name="HTML for fools">
</book>
</book>
</list>
So how do I get XmlDocument.OuterXml() to output xml will full closing tags rather than shorthand ?
EDIT - Added example to illustrate
<html><body>
<xml id="myBooks">
<list>
<book id="123" name="XML for muppets" />
<book id="456" name="HTML for fools" />
</list>
</xml>
<script>
var oXml = document.getElementById("myBooks");
alert(oXml.innerHTML);
</script>
</body></html>