[XML-SIG] xmllib compatibility

Fred L. Drake, Jr. fdrake@acm.org
Mon, 3 Apr 2000 10:51:25 -0400 (EDT)


Andy Robinson writes:
 > (1) One of our users complained that this broke when the Python XML package
 > was installed.  He uses Debian, and says that the installer overwrites the
 > standard Python library xmllib with the one in xml.parsers.  Is this
 > correct?  If so, how can it be justified?  It seems guaranteed to cause

  This is a clear problem with the Debian packaging; the stock xmllib
should not be overwritten, especially since xml.parsers.xmllib is out
of date (and likely to remain that way, and disappear).  The Debian
package maintainer should be told to fix this.  (Is he listening?
Does anyone know who does this?)

 > (2) Anyway, he would like to use it, and if I can make things compatible I
 > will do.  I tried to change "import xmllib" to "from xml.parsers import
 > xmllib" and ran the script anyway, and discover that default keywords are no
 > longer supported.  For example, I had a tag like this...
 > 
 > <rectangle x="20" y="510" width="800" height="65" fill="(0,0,1)"/>
 > 
 > ...and the defaults for the old parser specified an 'stroke' attribute of
 > 'None', so I did not have to define the stroke for every shape in my XML
 > file.  As far as I can see, xml.parsers.xmllib.Fast/SlowXMLParser no longer
 > supports default attributes.  Is ths correct, or is there just another way
 > of doing it I have missed?

  This is an incompatibility between the two.  Convert to using SAX
with pyexpat, since that'll be standard in Python 1.6.


  -Fred

--
Fred L. Drake, Jr.	  <fdrake at acm.org>
Corporation for National Research Initiatives