• Home
  • Raw
  • Download

Lines Matching full:doc

17           "<!DOCTYPE doc PUBLIC 'http://xml.python.org/public'"
21 "]><doc attr='value'> text\n"
22 "<?pi sample?> <!-- comment --> <e/> </doc>")
28 return getDOMImplementation().createDocument(None, "doc", doctype)
31 doctype = getDOMImplementation().createDocumentType("doc", None, None)
48 doc = create_doc_without_doctype(doctype)
49 doctype.entities.item(0).ownerDocument = doc
50 doctype.notations.item(0).ownerDocument = doc
51 return doc
62 doc = Document()
63 self.assertFalse(doc.async_)
85 dom = parseString("<doc><foo/></doc>")
98 and root.toxml() == "<doc><element/><foo/></doc>"
110 and root.toxml() == "<doc><element/><foo/><element/></doc>"
123 "<doc><element/><foo/><bar/><element/></doc>"
128 dom = parseString("<doc/>")
429 def get_empty_nodelist_from_elements_by_tagName_ns_helper(self, doc, nsuri, argument
431 nodelist = doc.getElementsByTagNameNS(nsuri, lname)
435 doc = parseString('<doc/>')
437 doc, 'http://xml.python.org/namespaces/a', 'localname')
439 doc, '*', 'splat')
441 doc, 'http://xml.python.org/namespaces/a', '*')
443 doc = parseString('<doc xmlns="http://xml.python.org/splat"><e/></doc>')
445 doc, "http://xml.python.org/splat", "not-there")
447 doc, "*", "not-there")
449 doc, "http://somewhere.else.net/not-there", "e")
558 doc = parseString("<doc/>")
559 elem = doc.createElement("extra")
561 self.assertRaises(xml.dom.HierarchyRequestErr, doc.appendChild, elem)
563 doc.unlink()
586 doc = parseString("<doc a=''/>")
587 e = doc.documentElement
595 doc = parseString("<doc xmlns:a='http://xml.python.org/' a:b=''/>")
596 e = doc.documentElement
629 dom = parseString("<doc><foo/></doc>")
630 doc = dom.documentElement
631 self.assertTrue(doc.hasChildNodes())
632 dom2 = parseString("<doc/>")
657 dom = parseString("<doc attr='value'><foo/></doc>")
673 and clone.toxml() == '<doc attr="value"/>'
682 and clone.toxml() == '<doc attr="value"><foo/></doc>'
687 doc = parseString("<?xml version='1.0'?>\n"
689 "<!DOCTYPE doc [\n"
692 "<doc attr='value'/>")
693 doc2 = doc.cloneNode(0)
699 doc = parseString("<?xml version='1.0'?>\n"
701 "<!DOCTYPE doc [\n"
704 "<doc attr='value'/>")
705 doc2 = doc.cloneNode(1)
706 self.confirm(not (doc.isSameNode(doc2) or doc2.isSameNode(doc)),
708 self.confirm(len(doc.childNodes) == len(doc2.childNodes),
714 self.confirm(not doc.documentElement.isSameNode(doc2.documentElement),
716 if doc.doctype is not None:
721 self.confirm(not doc.doctype.isSameNode(doc2.doctype))
758 doc = create_doc_with_doctype()
759 clone = doc.doctype.cloneNode(1)
777 doc = create_doc_with_doctype()
778 clone = doc.doctype.cloneNode(0)
782 doc1 = parseString("<doc/>")
783 doc2 = parseString("<doc/>")
807 doc = parseString("<doc attr='value'/>")
808 attr = doc.documentElement.getAttributeNode("attr")
827 doc = parseString("<?target data?><doc/>")
828 pi = doc.firstChild
849 <doc>Don't let entities make you frown &smile;</doc>
892 doc = parseString("<doc/>")
893 root = doc.documentElement
894 root.appendChild(doc.createTextNode("first"))
895 root.appendChild(doc.createTextNode("second"))
899 doc.normalize()
905 doc.unlink()
907 doc = parseString("<doc/>")
908 root = doc.documentElement
909 root.appendChild(doc.createTextNode(""))
910 doc.normalize()
914 doc.unlink()
917 doc = parseString("<doc/>")
918 root = doc.documentElement
919 root.appendChild(doc.createTextNode("first"))
920 root.appendChild(doc.createTextNode("second"))
921 root.appendChild(doc.createElement("i"))
925 doc.normalize()
935 doc.unlink()
938 doc = parseString("<doc/>")
939 root = doc.documentElement
940 root.appendChild(doc.createTextNode("first"))
941 root.appendChild(doc.createTextNode(""))
945 doc.normalize()
953 doc.unlink()
956 doc = parseString("<doc/>")
957 root = doc.documentElement
958 root.appendChild(doc.createTextNode(""))
959 root.appendChild(doc.createTextNode("second"))
963 doc.normalize()
971 doc.unlink()
974 doc = parseString("<doc/>")
975 root = doc.documentElement
976 root.appendChild(doc.createElement("i"))
977 root.appendChild(doc.createTextNode(""))
978 root.appendChild(doc.createElement("i"))
982 doc.normalize()
991 doc.unlink()
994 doc = parseString("<doc/>")
995 root = doc.documentElement
996 root.appendChild(doc.createTextNode(""))
997 root.appendChild(doc.createTextNode("second"))
998 root.appendChild(doc.createTextNode(""))
999 root.appendChild(doc.createTextNode("fourth"))
1000 root.appendChild(doc.createTextNode(""))
1004 doc.normalize()
1012 doc.unlink()
1015 doc = parseString("<doc>"
1031 "</doc>")
1032 root = doc.documentElement
1033 root.childNodes[0].appendChild(doc.createTextNode(""))
1034 root.childNodes[0].appendChild(doc.createTextNode("x"))
1035 root.childNodes[1].childNodes[0].appendChild(doc.createTextNode("x2"))
1036 root.childNodes[1].appendChild(doc.createTextNode("x3"))
1037 root.appendChild(doc.createTextNode(""))
1047 doc.normalize()
1074 doc.unlink()
1078 doc = parseString("<o>text</o>")
1079 text = doc.documentElement.childNodes[0]
1083 doc.unlink()
1086 doc = parseString("<o><i/>t</o>")
1087 node = doc.documentElement
1094 doc = parseString("<doc><?pi?>text?<elm/></doc>")
1095 root = doc.documentElement
1105 doc.unlink()
1108 doc = parseString(
1109 "<doc><elm1><elm2/><elm2><elm3/></elm2></elm1></doc>")
1110 root = doc.documentElement
1115 self.confirm(root.parentNode is doc and
1120 doc.unlink()
1123 doc = parseString("<doc><e/><e/></doc>")
1124 children = doc.childNodes
1132 doc.unlink()
1135 doc = parseString('<foo>&#x20ac;</foo>')
1136 self.assertEqual(doc.toxml(),
1138 self.assertEqual(doc.toxml('utf-8'),
1140 self.assertEqual(doc.toxml('iso-8859-15'),
1142 self.assertEqual(doc.toxml('us-ascii'),
1144 self.assertEqual(doc.toxml('utf-16'),
1153 doc.unlink()
1156 doc = parseString('<foo>&#x20ac;</foo>')
1157 self.assertEqual(doc.toxml(),
1159 self.assertEqual(doc.toxml(standalone=None),
1161 self.assertEqual(doc.toxml(standalone=True),
1163 self.assertEqual(doc.toxml(standalone=False),
1165 self.assertEqual(doc.toxml('utf-8', True),
1169 doc.unlink()
1202 def checkRenameNodeSharedConstraints(self, doc, node): argument
1204 self.assertRaises(xml.dom.NamespaceErr, doc.renameNode, node,
1206 doc2 = parseString("<doc/>")
1211 doc = parseString("<doc a='v'/>")
1212 elem = doc.documentElement
1217 attr = doc.renameNode(attr, xml.dom.EMPTY_NAMESPACE, "b")
1227 and attr.ownerDocument.isSameNode(doc)
1231 attr = doc.renameNode(attr, "http://xml.python.org/ns", "c")
1247 attr = doc.renameNode(attr, "http://xml.python.org/ns2", "p:d")
1266 attr = doc.renameNode(attr, xml.dom.EMPTY_NAMESPACE, "e")
1282 self.assertRaises(xml.dom.NamespaceErr, doc.renameNode, attr,
1284 self.checkRenameNodeSharedConstraints(doc, attr)
1285 doc.unlink()
1288 doc = parseString("<doc/>")
1289 elem = doc.documentElement
1292 elem = doc.renameNode(elem, xml.dom.EMPTY_NAMESPACE, "a")
1298 and elem.ownerDocument.isSameNode(doc))
1301 elem = doc.renameNode(elem, "http://xml.python.org/ns", "b")
1307 and elem.ownerDocument.isSameNode(doc))
1310 elem = doc.renameNode(elem, "http://xml.python.org/ns2", "p:c")
1316 and elem.ownerDocument.isSameNode(doc))
1319 elem = doc.renameNode(elem, xml.dom.EMPTY_NAMESPACE, "d")
1325 and elem.ownerDocument.isSameNode(doc))
1327 self.checkRenameNodeSharedConstraints(doc, elem)
1328 doc.unlink()
1333 doc = xml.dom.minidom.getDOMImplementation().createDocument(
1335 node = doc.createComment("comment")
1336 self.assertRaises(xml.dom.NotSupportedErr, doc.renameNode, node,
1338 doc.unlink()
1341 doc = parseString("<doc>a</doc>")
1342 elem = doc.documentElement
1347 elem.appendChild(doc.createTextNode("b"))
1349 elem.insertBefore(doc.createCDATASection("c"), text)
1353 splitter = doc.createComment("comment")
1355 text2 = doc.createTextNode("d")
1360 x = doc.createElement("x")
1366 x = doc.createProcessingInstruction("y", "z")
1377 doc = parseString("<doc><e/></doc>")
1378 elem = doc.documentElement
1387 doc = parseString("<doc>a<e/>d</doc>")
1388 elem = doc.documentElement
1392 elem.insertBefore(doc.createTextNode("b"), splitter)
1393 elem.insertBefore(doc.createCDATASection("c"), text1)
1394 return doc, elem, text1, splitter, text2
1396 doc, elem, text1, splitter, text2 = setup()
1402 doc, elem, text1, splitter, text2 = setup()
1408 doc, elem, text1, splitter, text2 = setup()
1415 doc = parseString(
1416 "<!DOCTYPE doc [\n"
1419 " <!ATTLIST doc id ID #IMPLIED \n"
1429 "]><doc id='name' notid='name' text='splat!' enum='b'"
1432 elem = doc.documentElement
1448 doc = parseString("<doc a1='v' a2='w'/>")
1449 e = doc.documentElement
1452 self.confirm(doc.getElementById("v") is None
1456 self.confirm(e.isSameNode(doc.getElementById("v"))
1460 self.confirm(e.isSameNode(doc.getElementById("v"))
1461 and e.isSameNode(doc.getElementById("w"))
1465 a3 = doc.createAttribute("a1")
1468 self.confirm(doc.getElementById("v") is None
1469 and e.isSameNode(doc.getElementById("w"))
1474 doc.renameNode(a2, xml.dom.EMPTY_NAMESPACE, "an")
1475 self.confirm(e.isSameNode(doc.getElementById("w"))
1481 doc = parseString("<doc"
1485 e = doc.documentElement
1488 self.confirm(doc.getElementById("v") is None
1492 self.confirm(e.isSameNode(doc.getElementById("v"))
1496 self.confirm(e.isSameNode(doc.getElementById("v"))
1497 and e.isSameNode(doc.getElementById("w"))
1501 a3 = doc.createAttributeNS(NS1, "a1")
1504 self.confirm(e.isSameNode(doc.getElementById("w")))
1508 self.confirm(doc.getElementById("v") is None)
1510 doc.renameNode(a2, xml.dom.EMPTY_NAMESPACE, "an")
1511 self.confirm(e.isSameNode(doc.getElementById("w"))
1517 doc = parseString("<doc"
1521 e = doc.documentElement
1524 self.confirm(doc.getElementById("v") is None
1528 self.confirm(e.isSameNode(doc.getElementById("v"))
1532 self.confirm(e.isSameNode(doc.getElementById("v"))
1533 and e.isSameNode(doc.getElementById("w"))
1537 a3 = doc.createAttributeNS(NS1, "a1")
1540 self.confirm(e.isSameNode(doc.getElementById("w")))
1544 self.confirm(doc.getElementById("v") is None)
1546 doc.renameNode(a2, xml.dom.EMPTY_NAMESPACE, "an")
1547 self.confirm(e.isSameNode(doc.getElementById("w"))
1550 def assert_recursive_equal(self, doc, doc2): argument
1551 stack = [(doc, doc2)]
1582 self.assertTrue(n1.ownerDocument.isSameNode(doc))
1588 doc = parseString(sample)
1590 s = pickle.dumps(doc, proto)
1592 self.assert_recursive_equal(doc, doc2)
1595 doc = parseString(sample)
1596 doc2 = copy.deepcopy(doc)
1597 self.assert_recursive_equal(doc, doc2)
1600 doc = create_doc_without_doctype()
1601 doc.appendChild(doc.createComment("foo--bar"))
1602 self.assertRaises(ValueError, doc.toxml)
1606 doc = parseString("<element xmlns=''>\n"
1608 doc2 = parseString(doc.toxml())
1616 doc = parse(tstfile)
1617 title_tag = doc.documentElement.getElementsByTagName("TITLE")[0]
1618 self.assertRaises( xml.dom.NotFoundErr, doc.removeChild, title_tag)
1619 num_children_before = len(doc.childNodes)
1620 doc.removeChild(doc.childNodes[0])
1621 num_children_after = len(doc.childNodes)
1627 doc = parse(tstfile)
1628 pi = doc.createProcessingInstruction("y", "z")
1633 doc = parseString(xml_str)
1635 doc.writexml(output)
1640 doc = parseString(xml_str)
1641 self.assertEqual(doc.toxml(), xml_str)
1645 doc = parseString(xml_str)
1646 self.assertEqual(doc.toprettyxml(),
1652 doc = parseString(xml_str)
1653 self.assertEqual(doc.toprettyxml(),