[Pharo-dev] A small patch for Zinc (related to XMLParser)

Sven Van Caekenberghe sven at stfx.eu
Sun Dec 29 06:11:07 EST 2013


Hi Monty,

On 29 Dec 2013, at 07:47, monty <monty.os at engineer.com> wrote:

> Hi Sven. your ZnMimeType>>isBinary method is wrongly treating application/xml-dtd and other XML application subtypes like xml-external-parsed-entity as binary instead of text. To be consistent, if you're going to treat one applicaiton/xml type as text, you should treat them all that way. I attached a patch that fixes it by treating "-" as a subtype separator too. More info: http://www.ietf.org/rfc/rfc3023.txt

Excellent extension, I integrated it in Zinc upstream, bleedingEdge

===
Name: Zinc-Resource-Meta-Core-SvenVanCaekenberghe.30
Author: SvenVanCaekenberghe
Time: 29 December 2013, 12:05:01.614278 pm
UUID: 18ce8118-2e25-43f1-8524-0d6b817be8cb
Ancestors: Zinc-Resource-Meta-Core-SvenVanCaekenberghe.29

Extend ZnMimeType>>#isBinary to recognize application/xml-dtd (and more from http://www.ietf.org/rfc/rfc3023.txt) as non-binary by using both + and - as subtype separators when looking for xml (thanks monty);
Extend ZnMimeTypeTests>>testIsBinary to cover the new functionality
===
Name: Zinc-Resource-Meta-Tests-SvenVanCaekenberghe.18
Author: SvenVanCaekenberghe
Time: 29 December 2013, 12:05:30.83878 pm
UUID: 4c2e4a78-c496-41b7-9f5c-cd90b982a9d6
Ancestors: Zinc-Resource-Meta-Tests-SvenVanCaekenberghe.17

Extend ZnMimeType>>#isBinary to recognize application/xml-dtd (and more from http://www.ietf.org/rfc/rfc3023.txt) as non-binary by using both + and - as subtype separators when looking for xml (thanks monty);
Extend ZnMimeTypeTests>>testIsBinary to cover the new functionality
===

> Also, my lack of commit messages is because if I'm just making some small changes to private classes/methods or refactoring, I don't see the point in detailing it for users who don't (and shouldn't) care. They should just focus on the public API (which I haven't changed much).

Hmm, I think that for both the community and for yourself in half a year it is important to write commit messages like the one I wrote above. It does not have to go into much detail, something like ‘refactored the DOM parser for entities’ is enough - it will help hunting for regressions and other problems. The writeup of your changes that was in the email is already very helpful.

BTW, thanks for working on XML parser, it is an important tool.

> <ZnMimeType-isBinary.st>

Thanks again for the patch !

Regards,

Sven


--
Sven Van Caekenberghe
Proudly supporting Pharo
http://pharo.org
http://association.pharo.org
http://consortium.pharo.org








More information about the Pharo-dev mailing list