| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <script type="text/javascript"> |
| function runTest() |
| { |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| var target = document.getElementById("target"); |
| |
| var xmlns = "http://www.w3.org/XML/1998/namespace"; |
| |
| // XML with correct xml prefix on space |
| var xml1 = document.createElementNS(xmlns, "foo"); |
| xml1.setAttributeNS(xmlns, 'xml:space', 'preserve'); |
| |
| var xml2 = document.createElementNS(xmlns, "bar"); |
| xml2.setAttributeNS(xmlns, 'space', 'default'); |
| |
| target.appendChild(xml1); |
| target.appendChild(xml2); |
| |
| var serializer = new XMLSerializer(); |
| var xmlString = serializer.serializeToString(target); |
| |
| var outputText = document.getElementById("output"); |
| outputText.textContent = xmlString; |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <div id="target"/> |
| <div id="output"/> |
| </body> |
| </html> |