OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 Copyright © 2001-2004 World Wide Web Consortium, | 3 Copyright © 2001-2004 World Wide Web Consortium, |
4 (Massachusetts Institute of Technology, European Research Consortium | 4 (Massachusetts Institute of Technology, European Research Consortium |
5 for Informatics and Mathematics, Keio University). All | 5 for Informatics and Mathematics, Keio University). All |
6 Rights Reserved. This work is distributed under the W3C® Software License [1] i
n the | 6 Rights Reserved. This work is distributed under the W3C® Software License [1] i
n the |
7 hope that it will be useful, but WITHOUT ANY WARRANTY; without even | 7 hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
8 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 8 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
9 | 9 |
10 [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 | 10 [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 109 } |
110 doc = load(docRef, "doc", "hc_staff"); | 110 doc = load(docRef, "doc", "hc_staff"); |
111 docElem = doc.documentElement; | 111 docElem = doc.documentElement; |
112 | 112 |
113 rootName = docElem.tagName; | 113 rootName = docElem.tagName; |
114 | 114 |
115 rootNS = docElem.namespaceURI; | 115 rootNS = docElem.namespaceURI; |
116 | 116 |
117 domImpl = doc.implementation; | 117 domImpl = doc.implementation; |
118 newDoc = domImpl.createDocument(rootNS,rootName,nullDocType); | 118 newDoc = domImpl.createDocument(rootNS,rootName,nullDocType); |
119 newAttr = doc.createAttributeNS(xmlNS,"xml:lang"); | 119 newAttr = doc.createAttribute("xml:lang"); |
120 adoptedAttr = newDoc.adoptNode(newAttr); | 120 adoptedAttr = newDoc.adoptNode(newAttr); |
121 | 121 |
122 if( | 122 if( |
123 | 123 |
124 (adoptedAttr != null) | 124 (adoptedAttr != null) |
125 | 125 |
126 ) { | 126 ) { |
127 nodeName = adoptedAttr.nodeName; | 127 nodeName = adoptedAttr.nodeName; |
128 | 128 |
129 nodeNamespaceURI = adoptedAttr.namespaceURI; | 129 nodeNamespaceURI = adoptedAttr.namespaceURI; |
130 | 130 |
131 nodePrefix = adoptedAttr.prefix; | 131 nodePrefix = adoptedAttr.prefix; |
132 | 132 |
133 attrOwnerElem = adoptedAttr.ownerElement; | 133 attrOwnerElem = adoptedAttr.ownerElement; |
134 | 134 |
135 isSpecified = adoptedAttr.specified; | 135 isSpecified = adoptedAttr.specified; |
136 | 136 |
137 assertEquals("documentadoptnode04_nodeName","xml:lang",nodeName); | 137 assertEquals("documentadoptnode04_nodeName","xml:lang",nodeName); |
138 assertEquals("documentadoptnode04_namespaceURI",xmlNS,nodeNamespaceURI); | |
139 assertEquals("documentadoptnode04_prefix","xml",nodePrefix); | 138 assertEquals("documentadoptnode04_prefix","xml",nodePrefix); |
140 assertNull("documentadoptnode04_ownerDoc",attrOwnerElem); | 139 assertNull("documentadoptnode04_ownerDoc",attrOwnerElem); |
141 assertTrue("documentadoptnode04_specified",isSpecified); | 140 assertTrue("documentadoptnode04_specified",isSpecified); |
142 | 141 |
143 } | 142 } |
144 | 143 |
145 } | 144 } |
146 | 145 |
147 | 146 |
148 | 147 |
149 | 148 |
150 function runTest() { | 149 function runTest() { |
151 documentadoptnode04(); | 150 documentadoptnode04(); |
152 } | 151 } |
OLD | NEW |