[Twisted-Python] Re: [XML-SIG] Re: Can anyone recommend a sensible XML parser for Python?

Well, what do you think is the most useful behavior of cloning a document? Is it the one I posted in response to thread? If so, don't you think the element of surprise is too great (I'd be surprised myself at that behavior)? Wouldn't it be better for Python/XML to offer a *separate*, specialized function for cloning nodes, rather than doing weird things with cloneNode?
I see. It sounds as if a general document duplication function would be of use to you. I agree that this would be useful. I'm willing to write one and add it to xml.dom.ext. But I don't think this is a use case for node.cloneNode.
I don't remember. What did it do when it "worked"?
Was it ever documented? Every software module has undocumented "features" that you use at your peril. I don't think it's fair to complain when these appear and disappear. Then again, the poor state of PyXML documentation in general weakens that point of mine, doesn't it? Ah well.
I sympethize. It's largely because of Red Hat that it took us so long to drop 1.5 support in 4Suite. But a couple of months ago we decided it is not worth the developemtn and support overhead and ditched support for all versions before 2.1. I sleep better since then :-)
I think you take the wrong gloss on my words. I think Linus Torvalds himself would take years to write a complete and correct XML parser. It's the nature of the beast (XML), not the programmer. I certainly do not consider myself smart enough to take on that dragon. I'm just glad to lean on folk like Clark (and Drake, Evans and co), Garshol and Viellard.
My sophomoric attempt at an XML parser is now in Twisted CVS.
Interesting. So how did you test it?
I would rather write a Web server, another RPC, another async socket server *and* another DBMS interface all in a row than just take on the single task of writing an XML parser. And I think I can speak authoritatively, because I *have* implemented all four of those things.
As I said, I am very skeptical of the result. I'll be impressed when you tell me your home-brew XML parser passes the OASIS conformance suite. Anyway, this is all moot argument. It looks as if you've satisfied yourself for now. Good luck. -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com Track chair, XML/Web Services One Boston: http://www.xmlconference.com/ Basic XML and RDF techniques for knowledge management, Part 7 - http://www-106.ibm.com/developerworks/xml/library/x-think12.html Keeping pace with James Clark - http://www-106.ibm.com/developerworks/xml/libra ry/x-jclark.html Python and XML development using 4Suite, Part 3: 4RDF - http://www-105.ibm.com/developerworks/education.nsf/xml-onlinecourse-bytitle... 1EA5A2CF4621C386256BBB006F4CEC

Uche Ogbuji writes:
Wouldn't it be better for Python/XML to offer a *separate*, specialized function for cloning nodes, rather than doing weird things with cloneNode?
Why? I'd rather make cloneNode() do the right thing, and it seems rather clear what that should be. Certainly more clear than for DocumentType nodes. ;-)
I think it's a perfectly valid use case for Document.cloneNode().
Then again, the poor state of PyXML documentation in general weakens that point of mine, doesn't it? Ah well.
There is that. ;-) Perhaps before making something stop working (for some definition of "work"), the documentation should be checked for contracts and updated if some under-specified behavior should be consider beyond the contract. Removing features tends to be frowned upon in the Python world, especially if the documentation for what something should do is just plain missing -- it becomes really hard to say what isn't in the contract, because nobody said what *is* in the contract. Glyph:
Hey, at least PyXML makes that part easy, since Python 2.0 support is still in it's contract! ;-) On the other hand, it's painful because we end up with cruft like xml.dom.minicompat to make things work reasonably with newer Pythons and still work for older versions. I'm waiting for the day we can assume there are new-style objects, and everything works.
Hear ye, hear ye!
Heck, even Expat doesn't pass that yet! (We are making progress, though.) -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation

Uche Ogbuji writes:
Wouldn't it be better for Python/XML to offer a *separate*, specialized function for cloning nodes, rather than doing weird things with cloneNode?
Why? I'd rather make cloneNode() do the right thing, and it seems rather clear what that should be. Certainly more clear than for DocumentType nodes. ;-)
I think it's a perfectly valid use case for Document.cloneNode().
Then again, the poor state of PyXML documentation in general weakens that point of mine, doesn't it? Ah well.
There is that. ;-) Perhaps before making something stop working (for some definition of "work"), the documentation should be checked for contracts and updated if some under-specified behavior should be consider beyond the contract. Removing features tends to be frowned upon in the Python world, especially if the documentation for what something should do is just plain missing -- it becomes really hard to say what isn't in the contract, because nobody said what *is* in the contract. Glyph:
Hey, at least PyXML makes that part easy, since Python 2.0 support is still in it's contract! ;-) On the other hand, it's painful because we end up with cruft like xml.dom.minicompat to make things work reasonably with newer Pythons and still work for older versions. I'm waiting for the day we can assume there are new-style objects, and everything works.
Hear ye, hear ye!
Heck, even Expat doesn't pass that yet! (We are making progress, though.) -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation
participants (3)
-
Fred L. Drake, Jr.
-
Steve Waterbury
-
Uche Ogbuji