summaryrefslogtreecommitdiffstats
path: root/Lib/xml
Commit message (Collapse)AuthorAgeFilesLines
* Add missing self. before curNode. This may need to be committedNeal Norwitz2003-06-291-1/+1
| | | | to PyXML, I'm not sure of the procedure.
* Whitespace normalization.Tim Peters2003-04-244-5/+5
|
* SF patch #701494: more apply removalsRaymond Hettinger2003-04-061-2/+2
|
* Get rid of many apply() calls.Guido van Rossum2003-02-272-2/+2
|
* SF patch 672098: Three __contains__ implementationsRaymond Hettinger2003-01-301-0/+3
| | | | Contributed by Jp Calderone.
* Require PyXML 0.8.2.Martin v. Löwis2003-01-261-1/+1
|
* Merge with PyXML 1.3:Martin v. Löwis2003-01-261-0/+23
| | | | | | | Add support for the DOM Level 3 (draft) DOMImplementationSource interface to the xml.dom and xml.dom.minidom modules. Note API issue: the draft spec says to return null when there is no suitable implementation, while the Python getDOMImplementation() function raises ImportError (minor).
* Merge with PyXML 1.34: Correct typo. Fixes #674700.Martin v. Löwis2003-01-261-1/+1
|
* Merge with PyXML 1.82:Martin v. Löwis2003-01-261-8/+12
| | | | | Correct various typos. Fixes #674700. Set newly created attribute via setNamedItem.
* Import UserDataHandler from PyXML.Martin v. Löwis2003-01-251-0/+9
|
* Import NodeFilter from DOM2 Traversal/Range.Martin v. Löwis2003-01-251-0/+27
|
* Merge with PyXML 1.28:Martin v. Löwis2003-01-251-22/+71
| | | | | | | | | | | | | | | | | Wrap a lot of long lines. Clean up a handler for expat.error. If a lexical handler is set, make sure we call the startDTD() and endDTD(). If the lexical handler is unset (by setting it to None), remove the handlers from the underlying pyexpat parser object. Closes SF bug #485584. In namespaces mode, make sure we set up the qnames dictionary correctly for the AttributesNSImpl instance passed to the start-element-handler. Closes SF bug #563399. Support skippedEntity. Fixes #665486.
* Import from PyXML 1.10.Martin v. Löwis2003-01-251-0/+388
|
* Merge with PyXML 1.80:Martin v. Löwis2003-01-251-327/+1287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basic minidom changes to support the new higher-performance builder, as described: http://mail.python.org/pipermail/xml-sig/2002-February/007217.html Use True/False where appropriate. isSupported(): Implemented from DOM Level 2. Support a variety of things from the DOM Level 3 draft, integrate with the xml.dom.xmlbuilder module for the new Document and DOMImplementation methods. Support the NODE_CLONED callback for the UserDataHandler set using setUserData(). Add Entity and Notation nodes to minidom. Add __getitem__() to ReadOnlySequentialNamedNodeMap to match NamedNodeMap. TupleType was used without being defined; rename to _TupleType and define. Add magic so that instances of the NamedNodeMap (and its read-only cousin) take a bit less memory in the new-style world of Python 2.2/2.3. Now, the assignments to __slots__ actually work. ;-) Add support for the Text.wholeText attribute. Document.createCDATASection(): Do not pass unsupported arg to CDATASection constructor. Implemented Text.replaceWholeText(). Updated minidom interfaces to work better with current 4Suite XPath and Xslt. * Added childNodes to class Attr * Added localName and prefix to all Nodes * Added specified on class Attr * Changed DOMImplementation.createDocument to all creating a document with no document element and a Null doctype * Changed CharacterData__setattr__ to keep nodeValue and data in synch * fixed typo of ownerDoc in createDocumentFragment * Changed Comment to inherit from CharacterData * Allowed mutation of name on PIs * Added importNode and rewrote cloneNode so both use same code base * Changed EmptyNodeList to be a list not a tuple Use a table-driven DOMImplementation.hasFeature(). Shorten lines longer than 80 characters. Rename CloneNode to _clone_node (better naming consistency within the module). When defining localName as a property, the defproperty() call is needed for each class that defined _get_localName(), otherwise only the first version is used for Python 2.2 and newer. Node.insertBefore(): When the reference node is not found, raise the exception defined by the DOM specification. Attr._set_value(): Added setter that does the right thing. Childless.removeChild(): Raise the exception defined by the specification, even though it seem less than intuitive. _clone_node(): Access nodeType constants so we actually find them. Add support for document fragments. Node.removeChild(), .replaceChild(): Fix exception raised when a reference node is not found. CharacterData._set_data(): Update the nodeValue attribute as well as the data attribute. Entity.attributes, .childNodes: Added these attributes. Document.removeChild(): Raise the right exception when the node being removed is not a child of this node. Element.removeAttributeNode(): Raise the right exception when the node isn't present on this element. Don't unlink the node unless it is present. Added support for the following methods and accessors: Node._get_childNodes(), Attr._get_specified(), Attr._set_prefix(), NamedNodeMap.has_key(), .getNamedItem(), .getNamedItemNS(), .removeNamedItem(), .removeNamedItemNS(), ProcessingInstruction._get_data(), ._get_target(), ._set_data(), ._set_target(), CharacterData.__len__(), Document.getElementById(). Add many more of the _get_*() accessors. Convert internal helpers to use a more consistent naming convention. Remove unused definition of _nssplit(); there can be only one! Move the Identified mixin up so it can be used by one more class. Remove comment about NamedNodeMap.__getitem__(); the API won't be changing now! Way too late for that. Preliminary support for getElementById() for DOMs built with xml.dom.expatbuilder. Not necessarily very efficient, but it works, and is still fast for Document instances that do not have the ID information. DOMImplementation.createDocument(): Don't forget to add the DocumentType node to the tree. This appearantly was lost in the previous release. DocumentType.writexml(): New function. Implement the final determination on the behaviors of importNode() and cloneNode() with regard to Document and DocumentType nodes. When cloning and importing, call the UserDataHandler with the right operation, not just blindly use NODE_CLONED. parse(), parseString(): When called with parser=None, use xml.dom.expatbuilder instead of xml.dom.pulldom, to get a performance boost (the main point of expatbuilder). Fix for calling parse / parseString with a given parser instance; the else-paths were ignored when refactoring the function signatures; pychecker found that error instantly, BTW (hint, hint) Added pickle support for NamedNodeMap, ReadOnlySequentialNamedNodeMap, and ElementInfo. Closes SF bug #609641. In _clone_node for elements, fixed arguments for getAttributeNodeNS At least make sure the DOM API won't allow you to modify the child node list of an entity node (since entity ndoes are supposed to be readonly). Add support for the DOM Level 3 (draft) DOMImplementationSource interface to the xml.dom and xml.dom.minidom modules. Note API issue: the draft spec says to return null when there is no suitable implementation, while the Python getDOMImplementation() function raises ImportError (minor). Implement the DOM Level 3 Attr.isId property. Refactor the lookup of the ElementInfo objects. Implement the schemaType attribute for Element and Attr nodes. Defined by the (draft) DOM Level 3 specification. getElementById(): Support caching of IDs found. This implementation is sufficient for DOM Level 2 compliance, but additional changes will be needed to support the setIdAttribute() and setIdAttributeNS() methods in DOM Level 3. Add support for Text.isWhitespaceInElementContent (draft Level 3). NamedNodeMap.removeNamedItem(), .removeNamedItemNS(): Pass the new tests: Return the removed node, or raise NotFoundErr if there was no matching node. When changing attributes via a NamedNodeMap, update the ID-cache appropriately. Added support for the DOM Level 3 (draft) Element.setIdAttribute*() methods. setAttributeNode(): Be more careful about not calling removeAttributeNode() twice for a single node. Do more to avoid creating new Attr nodes, so that attributes do not lose their ID-ness when set using setIdAttribute*(). Work harder to avoid calls to Attr.__setattr__() and CharacterData.__setattr__(). Attr.unlink(): Implement everything directly instead of calling to the base class, which does several things that aren't needed for Attr nodes. Change some remaining assignments that caused __setattr__() to be called when it can be avoided. expatbuilder can now perform DOM construction without __setattr__() interferance in common cases. Remove unused _make_parent_nodes logic.
* Import expatbuilder, minicompat from PyXML.Martin v. Löwis2003-01-252-0/+1167
|
* Minor simplification.Fred Drake2002-10-281-2/+1
|
* Really do replacement of & last to avoid bad interactions between &Fred Drake2002-10-281-2/+2
| | | | replacement and replacements based on the entities parameter.
* Avoid calling __dict_replace() if we don't need to -- the call is muchFred Drake2002-10-281-8/+10
| | | | | more expensive than just doing to work needed, and these things seem to always turn into a bottleneck eventually.
* Patch #613256: Add nescape method to xml.sax.saxutils.Martin v. Löwis2002-10-261-6/+26
|
* New entries to track the DOM API growth. These match names exposed inFred Drake2002-08-091-0/+5
| | | | PyXML 0.8.
* Remove bogus assignment to self.length in NamedNodeMap.__delitem__().Fred Drake2002-07-021-1/+0
|
* Bump required PyXML version to 0.6.5.Martin v. Löwis2002-06-301-1/+1
|
* Implement the encoding argument for toxml and toprettyxml.Martin v. Löwis2002-06-301-8/+18
| | | | Document toprettyxml.
* Merge from PyXML:Martin v. Löwis2002-06-301-2/+26
| | | | | | [1.3] Added documentation of the namespace URI for elements with no namespace. [1.4] New property http://www.python.org/sax/properties/encoding. [1.5] Support optional string interning in pyexpat.
* Add xml namespace initially (PyXML 1.19).Martin v. Löwis2002-06-301-1/+2
|
* Fix spacing.Martin v. Löwis2002-06-301-1/+1
|
* Merge changes from PyXML:Martin v. Löwis2002-06-301-13/+76
| | | | | | | | | | | | | | | | | | | | [1.15] Added understanding of the feature_validation, feature_external_pes, and feature_string_interning features. Added support for the feature_external_ges feature. Added support for the property_xml_string property. [1.16] Made it recognize the namespace prefixes feature. [1.17] removed erroneous first line [1.19] Support optional string interning in pyexpat. [1.21] Restore compatibility with versions of Python that did not support weak references. These do not get the cyclic reference fix, but they will continue to work as they did before. [1.22] Activate entity processing unless standalone.
* Use more string methods, remove import stringNeal Norwitz2002-05-313-18/+12
|
* Not sure why the regression test missed this, but the PyXML tests caught it.Fred Drake2002-04-041-1/+1
| | | | We should get attributes from the right object.
* Avoid creating circular references between the ExpatParser and theFred Drake2002-04-041-1/+38
| | | | | | | ContentHandler. While GC will eventually clean up, it can take longer than normal for applications that create a lot of strings (or other immutables) rather without creating many containers. This closes SF bug #535474.
* [Apply patch #500457 from the PyXML tracker]Andrew M. Kuchling2002-03-201-0/+9
| | | | | | Add iterator support to pulldom.DOMEventStream New feature, so not a bugfix candidate (though it should be safe for inclusion)
* Wrap a couple of long lines.Fred Drake2002-03-151-2/+4
|
* Patch #527427: minidom fails to use NodeList sometimes.Martin v. Löwis2002-03-151-5/+5
|
* Attribute nodes did not always get their ownerDocument and ownerElementFred Drake2001-12-061-4/+11
| | | | properly set. This fixes that.
* Fix appendChild() and insertBefore() (and replaceChild() indirectly) whenFred Drake2001-12-061-2/+2
| | | | | the node being added is a fragment node. This closes SF bug #487929.
* Synchronize with pulldom from PyXML (revision 1.18).Fred Drake2001-11-301-2/+24
|
* Synchronize with minidom from PyXML (revision 1.35).Fred Drake2001-11-301-5/+5
|
* Added the convenience constants that are present in PyXML to make theseFred Drake2001-11-301-0/+6
| | | | more similar.
* Remove obsolete __dynamic__ distinction.Tim Peters2001-10-151-2/+0
|
* For Python 2.2, do not use __getattr__(), only use computed properties.Fred Drake2001-09-291-31/+61
| | | | | | This is probably a little bit faster, but mostly is just cleaner code. The old-style support is still used for Python versions < 2.2 so this source file can be shared with PyXML.
* Tighten up the new NodeList implementation.Fred Drake2001-09-281-7/+7
| | | | | Clean up a little; do not create an alias that is only used once, or store attributes with constant values in an instance.
* For Python 2.2 and newer, actually support the full NodeList interface byFred Drake2001-09-281-2/+19
| | | | subclassing list to add the length and item() attributes.
* Keep tabnanny happy.Guido van Rossum2001-09-191-1/+1
|
* Patch to bug #461754: CDATA should not undergo entity subst.Martin v. Löwis2001-09-191-1/+1
|
* Make sure XMLGenerator uses quoteattr() instead of escape() to quoteFred Drake2001-08-071-2/+2
| | | | | | | attribute values. Just using escape() can (and always has) led to broken XML being generated. This makes sure it always produces the right thing. This actually closes SF bug #440351.
* Add dead imports of modules that are "magically" imported.Martin v. Löwis2001-07-311-0/+5
|
* Get the whitespace right!Fred Drake2001-07-301-3/+3
|
* Ugly fix used when pyexpat is not available.Jeremy Hylton2001-07-301-0/+3
| | | | | | | | | | If pyexpat is not available and more than one attempt is made to load an expat-based xml parser, an empty xml.parser.expat module will be created. This empty module will confuse xml.sax.expatreader into thinking that pyexpat is available. The ugly fix is to verify that the expat module actually defines the names that are imported from pyexpat.
* Added function xml.sax.saxutils.quoteattr().Fred Drake2001-07-191-0/+21
| | | | This closes SF bug #440351. It should not be moved to Python 2.1.1.
* Patch #432117: Record namespaces in the DOM tree using the DOM xmlns prefix.Martin v. Löwis2001-07-181-1/+18
|