Parent Directory
|
Revision Log
See <http://suika.fam.cx/gate/2005/sw/prefix>
| 1 | wakaba | 1.1 | <html xmlns="http://www.w3.org/1999/xhtml"><head> |
| 2 | <title>Element.prefix = xml</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://www.w3.org/XML/1998/namespace", "xml:lang"); | ||
| 12 | } catch (e) { } | ||
| 13 | if (!el) { | ||
| 14 | try { | ||
| 15 | el = document.createAttributeNS ("http://www.w3.org/XML/1998/namespace", "lang"); | ||
| 16 | el.prefix = "xml"; | ||
| 17 | } catch (e) { } | ||
| 18 | } | ||
| 19 | var ok = (el && el.prefix == "xml" && | ||
| 20 | el.namespaceURI == "http://www.w3.org/XML/1998/namespace"); | ||