summaryrefslogtreecommitdiffstats
path: root/Lib/xml
Commit message (Collapse)AuthorAgeFilesLines
* Patch #102485 ] Check for legal children when adding children to a DOM nodeAndrew M. Kuchling2000-12-311-6/+30
|
* Merge with 1.8 of pulldom.py:Martin v. Löwis2000-12-281-1/+7
| | | | Use types.UnicodeType if available, not type(u"").
* Merge changes up to 1.10 from PyXML:Martin v. Löwis2000-12-281-1/+11
| | | | | | | - implement hasAttribute and hasAttributeNS (1.7) - Node.replaceChild(): Update the sibling nodes to point to newChild. Set the .nextSibling attribute on oldChild instead of adding a .newChild attribute (1.9).
* Patch #102492, fixing bug #116677:Andrew M. Kuchling2000-12-202-10/+42
| | | | | | | | | | give minidom.py behaviour that complies with the DOM Level 1 REC, which says that when a node newChild is added to the tree, "if the newChild is already in the tree, it is first removed." pulldom.py is patched to use the public minidom interface instead of setting .parentNode itself. Possibly this reduces pulldom's efficiency; someone else will have to pronounce on that.
* Do not assume that types.UnicodeType exists; we might be running in an oldFred Drake2000-12-161-1/+5
| | | | version of Python. ;-(
* Use the string module instead of string methods; this should still workFred Drake2000-12-161-1/+3
| | | | with Python 1.5.2 for now.
* Typo caught by /F -- thanks!Fred Drake2000-12-151-1/+1
|
* DOMException.__init__(): Remember to pass self to Exception.__init__().Fred Drake2000-12-151-1/+1
|
* Lots of small bug fixes and DOM API conformance improvements:Fred Drake2000-12-141-49/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make Node inherit from xml.dom.Node to pick up the NodeType values defined by the W3C recommendation. When raising AttributeError, be sure to provide the name of the attribute that does not exist. Node.normalize(): Make sure we do not allow an empty text node to survive as the first child; update the sibling links properly. _getElementsByTagNameNSHelper(): Make recursive calls using the right number of parameters. Attr.__setattr__(): Be sure to update name and nodeName at the same time since they are synonyms for this node type. AttributeList: Renamed to NamedNodeMap (AttributeList maintained as an alias). Compute the length attribute dynamically to allow the underlying structures to mutate. AttributeList.item(): Call .keys() on the dictionary rather than using self.keys() for performance. AttributeList.setNamedItem(), .setNamedItemNS(): Added methods. Text.splitText(): Added method. DocumentType: Added implementation class. DOMImplementation: Added implementation class. Document.appendChild(): Do not allow a second document element to be added. Document.documentElement: Find this dynamically, so that one can be removed and another added. Document.unlink(): Clear the doctype attribute. _get_StringIO(): Only use the StringIO module; cStringIO does not support Unicode.
* Adjust PullDOM to use a DOMImplementation instance to create new DocumentFred Drake2000-12-141-26/+37
| | | | | | | | | objects; uses minidom if one is not provided to the constructor. parse(): Pick up the default_bufsize default value dynamically so that the value in the module may be (meaningfully) changed at runtime. This (partially) closes patch #102477.
* When raising KeyError, provide the key value that failed.Fred Drake2000-12-131-4/+4
|
* Add code to DOMException to ensure it cannot be instantiated directly,Fred Drake2000-12-131-1/+8
| | | | | since the API documentation will state specifically that the specializations must be used by the DOM implementations.
* Add standard DOM exception hierarchy.Martin v. Löwis2000-12-131-0/+68
|
* Update the docstring.Fred Drake2000-12-111-2/+31
| | | | | Add a Node class that defines the NodeType constants, based on discussion in the XML-SIG.
* Reduce the visibility of imported modules for cleaner "from ... import *"Fred Drake2000-11-211-76/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | behavior. Added support for the Attr.ownerElement attribute. Everywhere: Define constant object attributes in the classes rather than on the instances during object construction. This reduces the amount of work needed for object construction and destruction; these need to be lightweight operations on a DOM. Node._get_firstChild(), Node._get_lastChild(): Return None if there are no children (required for compliance with DOM level 1). Node.insertBefore(): If refChild is None, append the new node instead of failing (required for compliance). Also, update the sibling relationships. Return the inserted node (required for compliance). Node.appendChild(): Update the parent of the appended node. Node.replaceChild(): Actually replace the old child! Update the parent and sibling relationships of both the old and new children. Return the replaced child (required for compliance). Node.normalize(): Implemented the normalize() method. Required for compliance, but missing from the release. Useful for joining adjacent Text nodes into a single node for easier processing. Node.cloneNode(): Actually make this work. Don't let the new node share the instance __dict__ with the original. Do proper recursion if doing a "deep" clone. Move the attribute cloning out of the base class, since only Element is supposed to have attributes. Node.unlink(): Simplify handling of child nodes for efficiency, and remove the attribute handling since only Element nodes support attributes. Attr.cloneNode(): Extend this to clear the ownerElement attribute in the clone. AttributeList.items(), AttributeList.itemsNS(): Slight performance improvement (avoid lambda). Element.cloneNode(): Extend Node.cloneNode() with support for the attributes. Clone the Attr objects after creating the underlying clone. Element.unlink(): Clean out the attributes here instead of in the base class, since this is the only class that will have them. Element.toxml(): Adjust to create only one AttributeList instance; minor efficiency improvement. _nssplit(): No need to re-import string. Document.__init__(): No longer needed once constant attributes are initialized in the class itself. Document.createElementNS(), Document.createAttributeNS(): Use the defined constructors rather than directly access the classes. _get_StringIO(): New function. Create an output StringIO using the most efficient available flavor. parse(), parseString(): Import pulldom here instead of in the public namespace of the module.
* Fix bug in prepare_input_source (patched by Paul P., sourceforge.net downLars Gustäbel2000-10-241-1/+1
| | | | now, so can't find number).
* Make reindent.py happy (lots of trailing whitespace removed).Fred Drake2000-10-239-104/+103
|
* Fixed a bug that caused namespace names to be reported as lists ratherLars Gustäbel2000-10-191-0/+2
| | | | than tuples.
* Fixed minor problem with reset().Lars Gustäbel2000-10-141-1/+2
|
* Moved appendChild calls back to DOMEventStream.Lars Gustäbel2000-10-131-7/+27
| | | | Added SAX2DOM class.
* Clear siblings, now that they are being set.Paul Prescod2000-10-131-0/+2
|
* Added parent attribute with getters and setters on XMLFilterBase.Lars Gustäbel2000-10-111-0/+12
|
* Added non-ns start and end element methods.Lars Gustäbel2000-10-111-16/+31
| | | | | Moved appendChild calls from DOMEventStream to PullDOM (parser indep). Removed duplicated sibling pointer setting (duplicated in appendChild).
* Paul Prescod <paul@prescod.net>:Fred Drake2000-10-091-0/+7
| | | | Correct the chaining between siblings.
* _exceptions: Format a missing system id as <unknown>.Martin v. Löwis2000-10-092-5/+7
| | | | expatreader: Use the error handler instead of raising exception directly.
* Don't use string methods to allow sharing this code with PyXML.Martin v. Löwis2000-10-071-1/+2
|
* Record bugs found when comparing the module with DOM Core Level 2.Martin v. Löwis2000-10-071-1/+4
|
* minidom: access attribute value before printing itMartin v. Löwis2000-10-062-12/+14
| | | | | | correct order of constructor args in createAttributeNS pulldom: use symbolic names for uri and localnames correct usage of createAttribute and setAttributeNode signatures.
* In an incremental parser, close the parser after feeding everything.Martin v. Löwis2000-10-061-0/+1
|
* Don't use a file object as system id; try to propagate the file name toMartin v. Löwis2000-10-061-1/+3
| | | | the InputSource.
* Don't report a final chunk for an external entity parser.Martin v. Löwis2000-10-061-1/+0
|
* Move translation from expat.error to SAXParseException into feed, so thatMartin v. Löwis2000-10-061-17/+19
| | | | | | | | | | callers of feed will get a SAXException. In close, feed the last chunk first before calling endDocument, so that the parser may report errors before the end of the document. Don't do anything in a nested parser. Don't call endDocument in parse; that will be called in close. Use self._source for finding the SystemID; XML_GetBase will be cleared in case of an error.
* Add SAXReaderNotAvailable, and use it to distinguish between anMartin v. Löwis2000-10-063-3/+25
| | | | ImportError, and a missing driver.
* Support non-namespace elements in *ElementNS of XMLGenerator.Martin v. Löwis2000-10-031-2/+10
|
* Use string functions instead of methods to allow sharing this module with PyXMLMartin v. Löwis2000-09-291-3/+5
|
* Remove dependency from saxutils when loading xmlreaderMartin v. Löwis2000-09-291-2/+1
|
* Fix handling of file inputs on Windows; passing them to urllib.urlopen()Fred Drake2000-09-261-3/+5
| | | | | | | | caused the drive letter to cause urlopen() to think it was an unrecognized URL scheme. This only passes system ids to urlopen() if the file does not exist. It works on Windows & Unix. It should work everywhere else as well.
* Include the version-detecting code to allow PyXML to override the "standard"Fred Drake2000-09-251-2/+19
| | | | xml package. Require at least PyXML 0.6.1.
* Fix inconsistent use of space/tabs.Thomas Wouters2000-09-251-4/+4
|
* Use SAX2 namespace support.Martin v. Löwis2000-09-241-28/+39
|
* [Patch 101634]Martin v. Löwis2000-09-242-26/+11
| | | | | | | xml.sax: Fix parse and parseString not to rely on ExpatParser Greatly simplify import logic by using __import__ saxutils: Support Unicode strings and files as parameters to prepare_input_source
* Find feature names in handler.Martin v. Löwis2000-09-241-3/+3
|
* Fixed another bug.Lars Gustäbel2000-09-241-1/+0
|
* Improvements to doco strings.Lars Gustäbel2000-09-244-14/+27
| | | | Tiny bug fix to expatreader.py (endDocument was only called after errors).
* Added EntityResolver and DTDHandler (patch 101631) with test cases.Lars Gustäbel2000-09-243-21/+54
|
* Added back the InputSource class (patch 101630).Lars Gustäbel2000-09-244-31/+138
|
* Updated to final Attributes interface (patch 101632).Lars Gustäbel2000-09-242-13/+72
|
* Updated to new SAX method signatures (*NS, patch 101573).Lars Gustäbel2000-09-241-6/+6
|
* Updated to new *NS signatures (patch 101573).Lars Gustäbel2000-09-241-25/+25
|
* Added back missing argument to ignorableWhitespace signature.Lars Gustäbel2000-09-241-1/+1
|