| 1 |
wakaba |
1.1 |
<html xmlns="http://www.w3.org/1999/xhtml"><head> |
| 2 |
|
|
<title>Attr.prefix = xml10name</title> |
| 3 |
|
|
</head><body> |
| 4 |
|
|
<p id="result" class="FAIL">FAIL (not executed)</p> |
| 5 |
|
|
<script type="text/javascript">// <![CDATA[ |
| 6 |
|
|
var result = document.getElementById ('result'); |
| 7 |
|
|
result.firstChild.data = 'FAIL (script error)'; |
| 8 |
|
|
|
| 9 |
|
|
var el; |
| 10 |
|
|
try { |
| 11 |
|
|
el = document.createAttributeNS ("http://test/", "originalPrefix:localName"); |
| 12 |
|
|
} catch (e) { } |
| 13 |
|
|
if (!el) { |
| 14 |
|
|
try { |
| 15 |
|
|
el = document.createAttributeNS ("http://test/", "localName"); |
| 16 |
|
|
el.prefix = "originalPrefix"; |
| 17 |
|
|
} catch (e) { } |
| 18 |
|
|
} |
| 19 |
|
|
var ok = (el && el.prefix == "originalPrefix" && |
| 20 |
|
|
el.namespaceURI == "http://test/"); |
| 21 |
|
|
|
| 22 |
|
|
if (ok) { |
| 23 |
|
|
try { |
| 24 |
|
|
el.prefix = "new:Prefix"; |
| 25 |
|
|
result.className = ''; |
| 26 |
|
|
result.firstChild.data = el.prefix + ', type ' + typeof (el.prefix); |
| 27 |
|
|
} catch (e) { |
| 28 |
|
|
result.className = ''; |
| 29 |
|
|
result.firstChild.data = e.toString (); |
| 30 |
|
|
} |
| 31 |
|
|
} else { |
| 32 |
|
|
result.className = 'NA'; |
| 33 |
|
|
result.firstChild.data = 'N/A'; |
| 34 |
|
|
} |
| 35 |
|
|
// ]]></script> |
| 36 |
|
|
</body></html> |
| 37 |
|
|
|