|
1 <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="test-to-html.xsl" type="text/xml"?> |
|
2 |
|
3 <!-- |
|
4 |
|
5 Copyright (c) 2001-2004 World Wide Web Consortium, |
|
6 (Massachusetts Institute of Technology, Institut National de |
|
7 Recherche en Informatique et en Automatique, Keio University). All |
|
8 Rights Reserved. This program is distributed under the W3C's Software |
|
9 Intellectual Property License. This program is distributed in the |
|
10 hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
|
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
12 PURPOSE. |
|
13 |
|
14 See W3C License http://www.w3.org/Consortium/Legal/ for more details. |
|
15 |
|
16 --> |
|
17 |
|
18 |
|
19 <test xmlns="http://www.w3.org/2001/DOM-Test-Suite/Level-3" name="nodereplacechild40"> |
|
20 <metadata> |
|
21 <title>nodereplacechild40</title> |
|
22 <creator>Curt Arnold</creator> |
|
23 <description> |
|
24 Attempt to add a second document element by a comment. The attempt should result |
|
25 in a HIERARCHY_REQUEST_ERR or NOT_SUPPORTED_ERR. |
|
26 </description> |
|
27 <date qualifier="created">2004-01-22</date> |
|
28 <subject resource="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#ID-785887307"/> |
|
29 </metadata> |
|
30 <var name="doc" type="Document"/> |
|
31 <var name="docElem" type="Element"/> |
|
32 <var name="rootName" type="DOMString"/> |
|
33 <var name="publicId" type="DOMString" isNull="true"/> |
|
34 <var name="systemId" type="DOMString" isNull="true"/> |
|
35 <var name="newComment" type="Comment"/> |
|
36 <var name="newDocType" type="DocumentType"/> |
|
37 <var name="domImpl" type="DOMImplementation"/> |
|
38 <var name="retNode" type="Node"/> |
|
39 <load var="doc" href="barfoo" willBeModified="true"/> |
|
40 <documentElement var="docElem" obj="doc"/> |
|
41 <tagName var="rootName" obj="docElem"/> |
|
42 <implementation var="domImpl" obj="doc"/> |
|
43 <createDocumentType var="newDocType" obj="domImpl" qualifiedName="rootName" |
|
44 publicId="publicId" systemId="systemId"/> |
|
45 <createComment var="newComment" obj="doc" data='"second element goes here"'/> |
|
46 <insertBefore var="retNode" obj="doc" newChild="newComment" refChild="docElem"/> |
|
47 <try> |
|
48 <replaceChild var="retNode" obj="doc" newChild="newDocType" oldChild="newComment"/> |
|
49 <fail id="throw_HIERARCHY_REQUEST_OR_NOT_SUPPORTED"/> |
|
50 <catch> |
|
51 <DOMException code="HIERARCHY_REQUEST_ERR"/> |
|
52 <DOMException code="NOT_SUPPORTED_ERR"/> |
|
53 </catch> |
|
54 </try> |
|
55 </test> |