1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
4
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6
<title>http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateattributeNS03</title>
7
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
8
<script type="text/javascript" src="/MochiKit/packed.js"></script><script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script><script type="text/javascript" src="DOMTestCase.js"></script><script type="text/javascript" src="exclusions.js"></script><script type="text/javascript">
9
// expose test function names
10
function exposeTestFunctionNames()
12
return ['documentcreateattributeNS03'];
15
var docsLoaded = -1000000;
19
// This function is called by the testing framework before
20
// running the test suite.
22
// If there are no configuration exceptions, asynchronous
23
// document loading is started. Otherwise, the status
24
// is set to complete and the exception is immediately
25
// raised when entering the body of the test.
27
function setUpPage() {
28
setUpPageStatus = 'running';
31
// creates test document builder, may throw exception
33
builder = createConfiguredBuilder();
38
if (typeof(this.doc) != 'undefined') {
41
docsLoaded += preload(docRef, "doc", "staffNS");
43
if (docsLoaded == 1) {
44
setUpPage = 'complete';
47
catchInitializationError(builder, ex);
48
setUpPage = 'complete';
53
// This method is called on the completion of
54
// each asychronous load started in setUpTests.
56
// When every synchronous loaded document has completed,
57
// the page status is changed which allows the
58
// body of the test to be executed.
59
function loadComplete() {
60
if (++docsLoaded == 1) {
61
setUpPageStatus = 'complete';
68
var docName = 'documentcreateattributeNS03';
73
The method createAttributeNS raises an INVALID_CHARACTER_ERR if the specified
74
qualified name contains an illegal character
76
Invoke the createAttributeNS method on this Document object with a valid value for
77
namespaceURI, and qualifiedNames that contain illegal characters. Check if the an
78
INVALID_CHARACTER_ERR was thrown.
82
* @see http://www.w3.org/TR/DOM-Level-2-Core/core
83
* @see http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS
85
function documentcreateattributeNS03() {
87
if(checkInitialization(builder, "documentcreateattributeNS03") != null) return;
90
var namespaceURI = "http://www.w3.org/DOM/Test/Level2";
92
qualifiedNames = new Array();
93
qualifiedNames[0] = "/";
94
qualifiedNames[1] = "//";
95
qualifiedNames[2] = "\\";
96
qualifiedNames[3] = ";";
97
qualifiedNames[4] = "&";
98
qualifiedNames[5] = "*";
99
qualifiedNames[6] = "]]";
100
qualifiedNames[7] = ">";
101
qualifiedNames[8] = "<";
105
if (typeof(this.doc) != 'undefined') {
108
doc = load(docRef, "doc", "staffNS");
109
for(var indexN65626 = 0;indexN65626 < qualifiedNames.length; indexN65626++) {
110
qualifiedName = qualifiedNames[indexN65626];
115
attribute = doc.createAttributeNS(namespaceURI,qualifiedName);
118
success = (typeof(ex.code) != 'undefined' && ex.code == 5);
120
assertTrue("documentcreateattributeNS03",success);
130
<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/core/documentcreateattributeNS03</h2>
133
Copyright (c) 2001-2004 World Wide Web Consortium,
134
(Massachusetts Institute of Technology, European Research Consortium
135
for Informatics and Mathematics, Keio University). All
136
Rights Reserved. This work is distributed under the <a href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231">W3C(r) Software License</a> in the
137
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
138
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.