Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / namespaces-1.html
blobd24b5feb3d83aee70ca3f2f540f1e1aa079838f8
1 <html>
2 <head>
3 <title>DOMParser namespace support</title>
4 <script type="text/javascript">
5 function execute()
7 if (window.testRunner) {
8 testRunner.dumpAsText();
11 var parser = new DOMParser();
12 var str =
13 '<?xml version="1.0"?>\n<doc>\n <foo xmlns="foobar" id="1">One</foo> <x:bar xmlns:x="barfoo" id="2">Two</x:bar>\n <d id="3">Three</d>\n</doc>\n';
14 var doc = parser.parseFromString(str,"text/xml");
16 document.getElementById("id1").firstChild.nodeValue = str;
17 document.getElementById("id2").firstChild.nodeValue = doc.getElementsByTagNameNS("foobar", "foo")[0].getAttribute("id");
18 document.getElementById("id3").firstChild.nodeValue = doc.getElementsByTagNameNS("barfoo", "bar")[0].getAttribute("id");
19 document.getElementById("id4").firstChild.nodeValue = doc.getElementsByTagNameNS("", "d")[0].getAttribute("id");
20 document.getElementById("id5").firstChild.nodeValue = doc.getElementsByTagNameNS(null, "d")[0].getAttribute("id");
23 </script>
24 </head>
25 <body onload="execute();">
27 <p>text to parse</p>
28 <p id="id1">@@No result@@</p>
29 <p>foobar:foo element</p>
30 <p id="id2">@@No result@@</p>
31 <p>barfoo:bar element</p>
32 <p id="id3">@@No result@@</p>
33 <p>d element (empty namespace)</p>
34 <p id="id4">@@No result@@</p>
35 <p>d element (null namespace)</p>
36 <p id="id5">@@No result@@</p>
38 </body>
39 </html>