37 |
|
|
38 |
package gnu.xml.dom; |
package gnu.xml.dom; |
39 |
|
|
40 |
|
import org.w3c.dom.DOMException; |
41 |
import org.w3c.dom.NamedNodeMap; |
import org.w3c.dom.NamedNodeMap; |
42 |
import org.w3c.dom.Node; |
import org.w3c.dom.Node; |
43 |
|
|
167 |
{ |
{ |
168 |
if (readonly) |
if (readonly) |
169 |
{ |
{ |
170 |
throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); |
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); |
171 |
} |
} |
172 |
|
|
173 |
DomNode node = (DomNode) arg; |
DomNode node = (DomNode) arg; |
174 |
if (node.owner != owner.owner) |
if (node.owner != owner.owner) |
175 |
{ |
{ |
176 |
throw new DomEx(DomEx.WRONG_DOCUMENT_ERR); |
throw new DomDOMException(DOMException.WRONG_DOCUMENT_ERR); |
177 |
} |
} |
178 |
if (node.nodeType != type) |
if (node.nodeType != type) |
179 |
{ |
{ |
180 |
throw new DomEx(DomEx.HIERARCHY_REQUEST_ERR); |
throw new DomDOMException(DOMException.HIERARCHY_REQUEST_ERR); |
181 |
} |
} |
182 |
if (node.nodeType == Node.ATTRIBUTE_NODE) |
if (node.nodeType == Node.ATTRIBUTE_NODE) |
183 |
{ |
{ |
184 |
DomNode element = node.parent; |
DomNode element = node.parent; |
185 |
if (element != null && element != owner) |
if (element != null && element != owner) |
186 |
{ |
{ |
187 |
throw new DomEx(DomEx.INUSE_ATTRIBUTE_ERR); |
throw new DomDOMException(DOMException.INUSE_ATTRIBUTE_ERR); |
188 |
} |
} |
189 |
node.parent = owner; |
node.parent = owner; |
190 |
node.depth = owner.depth + 1; |
node.depth = owner.depth + 1; |
303 |
{ |
{ |
304 |
if (readonly) |
if (readonly) |
305 |
{ |
{ |
306 |
throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR); |
throw new DomDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); |
307 |
} |
} |
308 |
|
|
309 |
// report attribute REMOVAL event? |
// report attribute REMOVAL event? |
370 |
return ctx; |
return ctx; |
371 |
} |
} |
372 |
} |
} |
373 |
throw new DomEx(DomEx.NOT_FOUND_ERR); |
throw new DomDOMException(DOMException.NOT_FOUND_ERR); |
374 |
} |
} |
375 |
|
|
376 |
String getDefaultValue(String name) |
String getDefaultValue(String name) |