El 23/11/2013 5:51, Camillo Bruni escribió:
opened https://pharo.fogbugz.com/f/cases/12229/XML-Tools-improvement otherwise
these changes are as good as lost.
sending mcz via mail is from the last century.
Maybe, but some of us are attending 30 requirements not related with
Pharo and do not have time to fill the bug cycle.
Hernán
On 2013-11-23, at 09:00, Stéphane Ducasse <stephane.duca...@inria.fr> wrote:
No time so fr to handle it.
Stef
Begin forwarded message:
From: "monty" <monty...@engineer.com>
Subject: Patches for Pharo packages you are maintaining
Date: November 21, 2013 3:14:25 AM GMT+01:00
To: stephane.duca...@inria.fr
Prof. Stef, I have produced updates to the XML-Parser, XML-Parser-Testing, and
XML-Writer-Core packages you are maintaining.
These updates add validation against internal and external DTDs, proper
replacement of general and parameter entites, customizable resolution of
external parsed entities using Zinc and FileSystem, awareness of notations and
unparsed entities, preservation of the internal DTD subset by the DOM parser
(so printing a parsed doc with a DTD will produce approximately what was
input), line numbers reporting in error messages, and better well-formed and
validity constraints.
I had to largely rewrite the tokenizer to make everything work, but I followed
the spec closely, and it is about the same speed as long as there is no DTD to
validate against.
One problem is that while the tests I added and the existing tests all pass, for some reason helper
messages in some test classes starting with "should" (in the style of should:raise:) are
being interpreted as tests and run by TestRuner, even though they don't begin with "test"
and take arguments! This is possibly a bug in TestRunner.
Another problem is that there are so many deprecated methods cluttering up
classes, some of which have been deprecated for years! It is confusing and hard
to see which methods to use just by browsing the protocols. I would really
suggest using this code to get rid of the XML-Parser methods that have been
deprecated for at least a year:
expiry := 1 year.
(SystemNavigation default allClassesInPackageNamed: 'XML-Parser')
do: [:class |
class selectors do: [:selector | | compiledMethod timeStamp |
compiledMethod := class compiledMethodAt: selector.
timeStamp := compiledMethod timeStamp copyAfter: Character space.
(compiledMethod isDeprecated
and: [(DateAndTime now - (DateAndTime fromString: timeStamp)) > expiry])
ifTrue: [class removeSelector: selector]]].
I ran and checked it myself and it doesn't break anything. Running the above
with XML-Writer-Core might not be a bad idea either.
I also updated BitmapCharacterSet to use less memory.
<XML-Writer-Core-monty.5.mcz>
<XML-Tests-Parser-monty.27.mcz>
<XML-Parser-monty.173.mcz>
<Collections-BitmapCharacterSet-Anonymous.6.mcz>
<Collections-BitmapCharacterSet-Anonymous.6.mcz>