Commit Graph

72 Commits

Author SHA1 Message Date
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
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
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
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
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
70d39a60a8 Re-indent. 2001-01-27 09:01:20 +00:00
Martin v. Löwis
711a5bdc44 Synchronize with PyXML 1.5. 2001-01-27 08:56:24 +00:00
Martin v. Löwis
0591725bc5 Synchronize with PyXML 1.10
Break cycle involving expat parser in close().
Add lex handler support to SAX2 pyexpat
2001-01-27 08:56:24 +00:00
Fred Drake
95b4ec5fbe Do not assume that types.UnicodeType exists; we might be running in an old
version of Python.  ;-(
2000-12-16 01:45:11 +00:00
Fred Drake
ec126dab9c When raising KeyError, provide the key value that failed. 2000-12-13 20:48:29 +00:00
Lars Gustäbel
4ced5e7675 Fix bug in prepare_input_source (patched by Paul P., sourceforge.net down
now, so can't find number).
2000-10-24 15:53:12 +00:00
Fred Drake
16f6329e61 Make reindent.py happy (lots of trailing whitespace removed). 2000-10-23 18:09:50 +00:00
Lars Gustäbel
d2f5a9ac4b Fixed a bug that caused namespace names to be reported as lists rather
than tuples.
2000-10-19 07:36:29 +00:00
Lars Gustäbel
55b4efd034 Fixed minor problem with reset(). 2000-10-14 10:28:01 +00:00
Lars Gustäbel
bc1b5c81a5 Added parent attribute with getters and setters on XMLFilterBase. 2000-10-11 22:35:00 +00:00
Martin v. Löwis
04f4943d13 _exceptions: Format a missing system id as <unknown>.
expatreader: Use the error handler instead of raising exception directly.
2000-10-09 16:45:54 +00:00
Martin v. Löwis
31b485ffb0 In an incremental parser, close the parser after feeding everything. 2000-10-06 21:12:12 +00:00
Martin v. Löwis
5fece7fc1b Don't use a file object as system id; try to propagate the file name to
the InputSource.
2000-10-06 21:11:20 +00:00
Martin v. Löwis
2aa93efda0 Don't report a final chunk for an external entity parser. 2000-10-06 21:10:34 +00:00
Martin v. Löwis
ee1dc157d7 Move translation from expat.error to SAXParseException into feed, so that
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.
2000-10-06 21:08:59 +00:00
Martin v. Löwis
962c9e7f91 Add SAXReaderNotAvailable, and use it to distinguish between an
ImportError, and a missing driver.
2000-10-06 17:41:52 +00:00
Martin v. Löwis
cf0a1cc417 Support non-namespace elements in *ElementNS of XMLGenerator. 2000-10-03 22:35:29 +00:00
Martin v. Löwis
3f0969f100 Use string functions instead of methods to allow sharing this module with PyXML 2000-09-29 19:00:40 +00:00
Martin v. Löwis
491ded78cc Remove dependency from saxutils when loading xmlreader 2000-09-29 18:59:50 +00:00
Fred Drake
0872e05851 Fix handling of file inputs on Windows; passing them to urllib.urlopen()
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.
2000-09-26 17:23:09 +00:00
Thomas Wouters
84da8aa7e2 Fix inconsistent use of space/tabs. 2000-09-25 00:11:37 +00:00
Martin v. Löwis
58af43fd76 [Patch 101634]
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
2000-09-24 21:31:06 +00:00
Martin v. Löwis
2066fa023c Find feature names in handler. 2000-09-24 21:17:39 +00:00
Lars Gustäbel
3a361f4f8b Fixed another bug. 2000-09-24 20:55:01 +00:00
Lars Gustäbel
bb757136b2 Improvements to doco strings.
Tiny bug fix to expatreader.py (endDocument was only called after errors).
2000-09-24 20:38:18 +00:00
Lars Gustäbel
e292a24589 Added EntityResolver and DTDHandler (patch 101631) with test cases. 2000-09-24 20:19:45 +00:00
Lars Gustäbel
523b0a6ec8 Added back the InputSource class (patch 101630). 2000-09-24 18:54:49 +00:00
Lars Gustäbel
32bf12eb8a Updated to final Attributes interface (patch 101632). 2000-09-24 18:39:23 +00:00
Lars Gustäbel
f43cf31f4a Updated to new *NS signatures (patch 101573). 2000-09-24 18:29:24 +00:00
Lars Gustäbel
358f4da29c Added back missing argument to ignorableWhitespace signature. 2000-09-24 11:06:27 +00:00
Lars Gustäbel
fc643c339d Bug fix to namespace handling in XMLGenerator (now adds declarations).
Bug fixes to XMLFilterBase (wrong ignorableWhitespace signature and
did not inherit set*Handler methods from XMLReader.)
2000-09-24 10:53:31 +00:00
Fred Drake
ddb486745b Conform more closely with the Python style guide. 2000-09-23 05:32:26 +00:00
Fred Drake
96ea196ea8 Use the public name for the Expat parser; "pyexpat" is deprecated. 2000-09-23 04:49:30 +00:00
Guido van Rossum
7fa7da861a More whitespace cleanup, to satisfy tabnanny.py. Don't trust -tt! 2000-09-22 09:30:29 +00:00