Lines Matching refs:root

102         root = dom.documentElement
103 elem = root.childNodes[0]
105 root.insertBefore(nelem, elem)
106 self.confirm(len(root.childNodes) == 2
107 and root.childNodes.length == 2
108 and root.childNodes[0] is nelem
109 and root.childNodes.item(0) is nelem
110 and root.childNodes[1] is elem
111 and root.childNodes.item(1) is elem
112 and root.firstChild is nelem
113 and root.lastChild is elem
114 and root.toxml() == "<doc><element/><foo/></doc>"
117 root.insertBefore(nelem, None)
118 self.confirm(len(root.childNodes) == 3
119 and root.childNodes.length == 3
120 and root.childNodes[1] is elem
121 and root.childNodes.item(1) is elem
122 and root.childNodes[2] is nelem
123 and root.childNodes.item(2) is nelem
124 and root.lastChild is nelem
126 and root.toxml() == "<doc><element/><foo/><element/></doc>"
129 root.insertBefore(nelem2, nelem)
130 self.confirm(len(root.childNodes) == 4
131 and root.childNodes.length == 4
132 and root.childNodes[2] is nelem2
133 and root.childNodes.item(2) is nelem2
134 and root.childNodes[3] is nelem
135 and root.childNodes.item(3) is nelem
138 and root.toxml() ==
674 root = dom.documentElement
675 clone = root.cloneNode(deep)
677 root, clone, "testCloneElement" + (deep and "Deep" or "Shallow"))
679 root.tagName = root.nodeName = "MODIFIED"
680 root.setAttribute("attr", "NEW VALUE")
681 root.setAttribute("added", "VALUE")
909 root = doc.documentElement
910 root.appendChild(doc.createTextNode("first"))
911 root.appendChild(doc.createTextNode("second"))
912 self.confirm(len(root.childNodes) == 2
913 and root.childNodes.length == 2,
916 self.confirm(len(root.childNodes) == 1
917 and root.childNodes.length == 1
918 and root.firstChild is root.lastChild
919 and root.firstChild.data == "firstsecond"
924 root = doc.documentElement
925 root.appendChild(doc.createTextNode(""))
927 self.confirm(len(root.childNodes) == 0
928 and root.childNodes.length == 0,
934 root = doc.documentElement
935 root.appendChild(doc.createTextNode("first"))
936 root.appendChild(doc.createTextNode("second"))
937 root.appendChild(doc.createElement("i"))
938 self.confirm(len(root.childNodes) == 3
939 and root.childNodes.length == 3,
942 self.confirm(len(root.childNodes) == 2
943 and root.childNodes.length == 2
944 and root.firstChild.data == "firstsecond"
945 and root.firstChild is not root.lastChild
946 and root.firstChild.nextSibling is root.lastChild
947 and root.firstChild.previousSibling is None
948 and root.lastChild.previousSibling is root.firstChild
949 and root.lastChild.nextSibling is None
955 root = doc.documentElement
956 root.appendChild(doc.createTextNode("first"))
957 root.appendChild(doc.createTextNode(""))
958 self.confirm(len(root.childNodes) == 2
959 and root.childNodes.length == 2,
962 self.confirm(len(root.childNodes) == 1
963 and root.childNodes.length == 1
964 and root.firstChild.data == "first"
965 and root.firstChild is root.lastChild
966 and root.firstChild.nextSibling is None
967 and root.firstChild.previousSibling is None
973 root = doc.documentElement
974 root.appendChild(doc.createTextNode(""))
975 root.appendChild(doc.createTextNode("second"))
976 self.confirm(len(root.childNodes) == 2
977 and root.childNodes.length == 2,
980 self.confirm(len(root.childNodes) == 1
981 and root.childNodes.length == 1
982 and root.firstChild.data == "second"
983 and root.firstChild is root.lastChild
984 and root.firstChild.nextSibling is None
985 and root.firstChild.previousSibling is None
991 root = doc.documentElement
992 root.appendChild(doc.createElement("i"))
993 root.appendChild(doc.createTextNode(""))
994 root.appendChild(doc.createElement("i"))
995 self.confirm(len(root.childNodes) == 3
996 and root.childNodes.length == 3,
999 self.confirm(len(root.childNodes) == 2
1000 and root.childNodes.length == 2
1001 and root.firstChild is not root.lastChild
1002 and root.firstChild.nextSibling is root.lastChild
1003 and root.firstChild.previousSibling is None
1004 and root.lastChild.previousSibling is root.firstChild
1005 and root.lastChild.nextSibling is None
1011 root = doc.documentElement
1012 root.appendChild(doc.createTextNode(""))
1013 root.appendChild(doc.createTextNode("second"))
1014 root.appendChild(doc.createTextNode(""))
1015 root.appendChild(doc.createTextNode("fourth"))
1016 root.appendChild(doc.createTextNode(""))
1017 self.confirm(len(root.childNodes) == 5
1018 and root.childNodes.length == 5,
1021 self.confirm(len(root.childNodes) == 1
1022 and root.childNodes.length == 1
1023 and root.firstChild is root.lastChild
1024 and root.firstChild.data == "secondfourth"
1025 and root.firstChild.previousSibling is None
1026 and root.firstChild.nextSibling is None
1048 root = doc.documentElement
1049 root.childNodes[0].appendChild(doc.createTextNode(""))
1050 root.childNodes[0].appendChild(doc.createTextNode("x"))
1051 root.childNodes[1].childNodes[0].appendChild(doc.createTextNode("x2"))
1052 root.childNodes[1].appendChild(doc.createTextNode("x3"))
1053 root.appendChild(doc.createTextNode(""))
1054 self.confirm(len(root.childNodes) == 3
1055 and root.childNodes.length == 3
1056 and len(root.childNodes[0].childNodes) == 4
1057 and root.childNodes[0].childNodes.length == 4
1058 and len(root.childNodes[1].childNodes) == 3
1059 and root.childNodes[1].childNodes.length == 3
1060 and len(root.childNodes[1].childNodes[0].childNodes) == 2
1061 and root.childNodes[1].childNodes[0].childNodes.length == 2
1064 self.confirm(len(root.childNodes) == 2
1065 and root.childNodes.length == 2
1066 and len(root.childNodes[0].childNodes) == 2
1067 and root.childNodes[0].childNodes.length == 2
1068 and len(root.childNodes[1].childNodes) == 2
1069 and root.childNodes[1].childNodes.length == 2
1070 and len(root.childNodes[1].childNodes[0].childNodes) == 1
1071 and root.childNodes[1].childNodes[0].childNodes.length == 1
1073 self.confirm(root.childNodes[0].childNodes[1].data == "tx"
1074 and root.childNodes[1].childNodes[0].childNodes[0].data == "t2x2"
1075 and root.childNodes[1].childNodes[1].data == "t3x3"
1077 self.confirm(root.childNodes[0].childNodes[1].nextSibling is None
1078 and root.childNodes[0].childNodes[1].previousSibling
1079 is root.childNodes[0].childNodes[0]
1080 and root.childNodes[0].childNodes[0].previousSibling is None
1081 and root.childNodes[0].childNodes[0].nextSibling
1082 is root.childNodes[0].childNodes[1]
1083 and root.childNodes[1].childNodes[1].nextSibling is None
1084 and root.childNodes[1].childNodes[1].previousSibling
1085 is root.childNodes[1].childNodes[0]
1086 and root.childNodes[1].childNodes[0].previousSibling is None
1087 and root.childNodes[1].childNodes[0].nextSibling
1088 is root.childNodes[1].childNodes[1]
1111 root = doc.documentElement
1112 (pi, text, elm) = root.childNodes
1126 root = doc.documentElement
1127 elm1 = root.childNodes[0]
1131 self.confirm(root.parentNode is doc and
1132 elm1.parentNode is root and
1678 xml_str = '<?xml version="1.0" ?><root><node><![CDATA[</data>]]></node></root>'
1682 '<root>\n'
1684 '</root>\n')
1687 xml_str = '<?xml version="1.0" ?><root><node><![CDATA[</data>]]></node></root>'