Commit Graph

157 Commits

Author SHA1 Message Date
Fred Drake 6d8905012c Minor simplification. 2002-10-28 18:09:41 +00:00
Fred Drake 407fea5197 Really do replacement of & last to avoid bad interactions between &
replacement and replacements based on the entities parameter.
2002-10-28 17:46:59 +00:00
Fred Drake f55222d98f Avoid calling __dict_replace() if we don't need to -- the call is much
more expensive than just doing to work needed, and these things seem
to always turn into a bottleneck eventually.
2002-10-28 17:29:01 +00:00
Martin v. Löwis 74b51ac1e5 Patch #613256: Add nescape method to xml.sax.saxutils. 2002-10-26 14:50:45 +00:00
Fred Drake a350270302 New entries to track the DOM API growth. These match names exposed in
PyXML 0.8.
2002-08-09 14:57:55 +00:00
Fred Drake 8e8dc419d0 Remove bogus assignment to self.length in NamedNodeMap.__delitem__(). 2002-07-02 17:27:06 +00:00
Martin v. Löwis adfa7409f8 Bump required PyXML version to 0.6.5. 2002-06-30 15:08:22 +00:00
Martin v. Löwis 7d650ca83b Implement the encoding argument for toxml and toprettyxml.
Document toprettyxml.
2002-06-30 15:05:00 +00:00
Martin v. Löwis 2ebfd09e58 Merge from PyXML:
[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.
2002-06-30 07:38:50 +00:00
Martin v. Löwis 0e2d881406 Add xml namespace initially (PyXML 1.19). 2002-06-30 07:32:56 +00:00
Martin v. Löwis d1b516c274 Fix spacing. 2002-06-30 07:27:30 +00:00
Martin v. Löwis 18476a3740 Merge changes from PyXML:
[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.
2002-06-30 07:21:24 +00:00
Neal Norwitz ab19962290 Use more string methods, remove import string 2002-05-31 20:46:39 +00:00
Fred Drake da204daeaa Not sure why the regression test missed this, but the PyXML tests caught it.
We should get attributes from the right object.
2002-04-04 19:12:31 +00:00
Fred Drake 012c81fc97 Avoid creating circular references between the ExpatParser and the
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.
2002-04-04 17:57:08 +00:00
Andrew M. Kuchling bdf1f19fee [Apply patch #500457 from the PyXML tracker]
Add iterator support to pulldom.DOMEventStream

New feature, so not a bugfix candidate (though it should be safe for inclusion)
2002-03-20 23:56:34 +00:00
Fred Drake 15b6893d95 Wrap a couple of long lines. 2002-03-15 14:37:23 +00:00
Martin v. Löwis 95700f7cde Patch #527427: minidom fails to use NodeList sometimes. 2002-03-15 13:51:59 +00:00
Fred Drake 2998a55f2d Attribute nodes did not always get their ownerDocument and ownerElement
properly set.  This fixes that.
2001-12-06 18:27:48 +00:00
Fred Drake e50959a58e Fix appendChild() and insertBefore() (and replaceChild() indirectly) when
the node being added is a fragment node.
This closes SF bug #487929.
2001-12-06 04:32:18 +00:00
Fred Drake 7fd173bfc4 Synchronize with pulldom from PyXML (revision 1.18). 2001-11-30 22:22:26 +00:00
Fred Drake 49a5d03ab4 Synchronize with minidom from PyXML (revision 1.35). 2001-11-30 22:21:58 +00:00
Fred Drake bd34b6bc3d Added the convenience constants that are present in PyXML to make these
more similar.
2001-11-30 15:37:33 +00:00
Tim Peters 6006629c3c Remove obsolete __dynamic__ distinction. 2001-10-15 22:53:29 +00:00
Fred Drake d157237d51 For Python 2.2, do not use __getattr__(), only use computed properties.
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.
2001-09-29 04:58:32 +00:00
Fred Drake 575712eaca Tighten up the new NodeList implementation.
Clean up a little; do not create an alias that is only used once, or store
attributes with constant values in an instance.
2001-09-28 20:25:45 +00:00
Fred Drake 3ac6a09eed For Python 2.2 and newer, actually support the full NodeList interface by
subclassing list to add the length and item() attributes.
2001-09-28 04:33:06 +00:00
Guido van Rossum 5b5e0b9bf9 Keep tabnanny happy. 2001-09-19 13:28:25 +00:00
Martin v. Löwis 5485404293 Patch to bug #461754: CDATA should not undergo entity subst. 2001-09-19 09:08:19 +00:00
Fred Drake dad91dd1e9 Make sure XMLGenerator uses quoteattr() instead of escape() to quote
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.
2001-08-07 19:14:46 +00:00
Martin v. Löwis 6cd441d129 Add dead imports of modules that are "magically" imported. 2001-07-31 08:54:55 +00:00
Fred Drake c974bf4dc2 Get the whitespace right! 2001-07-30 22:41:23 +00:00
Jeremy Hylton e3c37d660f Ugly fix used when pyexpat is not available.
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.
2001-07-30 21:49:22 +00:00
Fred Drake acd32d3be5 Added function xml.sax.saxutils.quoteattr().
This closes SF bug #440351.  It should not be moved to Python 2.1.1.
2001-07-19 16:10:15 +00:00
Martin v. Löwis 984158d25b Patch #432117: Record namespaces in the DOM tree using the DOM xmlns prefix. 2001-07-18 15:30:25 +00:00
Fred Drake fbe7b4fc8c Make the implementations of getElementsByTagName() and
getElementsByTagNameNS() consistent in form as well as functionality
(cosmetic).
2001-07-04 06:25:53 +00:00
Martin v. Löwis fb73bb129b Synchronize with 1.13 of PyXML:
Allow application to set a new content handler and lex_prop handler during
parsing. Closes bug #433761.
Small hack to make expat be ignored in Jython.
2001-06-17 07:05:43 +00:00
Martin v. Löwis 2c07195574 Previous check-in was by mistake, undo it. 2001-06-07 05:52:17 +00:00
Martin v. Löwis 22adac50cb Patch #416220: Fix misplaced paren. 2001-06-07 05:49:05 +00:00
Martin v. Löwis ed525fb0df Fix getElementsByTagNameNS:
- actually return a result
  - Compare with tag.localName in getElementsByTagNameNSHelper
2001-06-03 14:06:42 +00:00
Fred Drake dc806704b5 Corrected default value of the DocumentType.internalSubset attribute based
on a clarification sent to the www-dom list.
2001-04-05 14:41:30 +00:00
Fred Drake 33d2b84b2c CharacterData methods: Update self.length on changes instead of extended
the __getattr__() handler.

Text.splitText():  Update the length and nodeValue attributes.
2001-04-04 15:15:18 +00:00
Fred Drake 87432f42f9 Add support for the CharacterData methods, CDATASection. 2001-04-04 14:09:46 +00:00
Martin v. Löwis cb67ea1d6e Initialize Attr.value with empty string in createAttribute*, as per DOM
spec. Closes bug #412036.
Also reindent toprettyxml.
2001-03-31 16:30:40 +00:00
Martin v. Löwis 764dad5b13 Arghh. Fix typo. 2001-03-27 21:38:15 +00:00
Martin v. Löwis c9494ac0ff Use Guido's trick for always extracting the version number from a
CVS Revision string correctly, even under -kv.
2001-03-27 08:42:12 +00:00
Fred Drake 6526bf863e When creating an attribute node using createAttribute() or
createAttributeNS(), use the parallel setAttributeNode() or
setAttributeNodeNS() to add the node to the document -- do not assume
that setAttributeNode() will operate properly for both.
2001-03-23 04:39:24 +00:00
Martin v. Löwis b374dd3a81 Synchronize with 1.6 of PyXML:
Retrieve relevant information at construction time, as it may be lost
when the exception is printed.
2001-03-22 15:34:02 +00:00
Fred Drake 904f2fcbd7 Import the exceptions that this module can raise. 2001-03-14 22:43:47 +00:00
Martin v. Löwis 126f2f62db Patch #407965: Improve Level 2 conformance of minidom
- addition of a DocumentFragment implementation and createDocumentFragment method
- proper setting of ownerDocument for all nodes
- setting of namespaceURI to None in Element as a class attribute
- addition of setAttributeNodeNS and removeAttributeNodeNS as aliases
  for setAttributeNode and removeAttributeNode
- support for inheriting from DOMImplementation to extend it with
  additional features (to override the Document class)
in pulldom:
- support for nodes (comment and PI) that occur before he document element;
  that became necessary as pulldom now delays creation of the document
  until it has the document element.
2001-03-13 10:50:13 +00:00