[squeak-dev] Re: XMLParser weirdness

Andreas Raab andreas.raab at gmx.de
Tue Aug 10 20:08:14 UTC 2010


On 8/10/2010 12:33 PM, Bert Freudenberg wrote:
> Sounds like #isEmpty is buggy, it certainly should look at both contents and elements. And "canonical" may mean that there are no empty "shorthand" tags but always an opening and closing tag.

Good theory, but it seems that in that case the test that says:

	(writer canonical not
		and: [self isEmpty and: [self attributes isEmpty not]])

could be shortened to just

	(writer canonical not
		and: [self isEmpty])

no? I mean why would it matter if the list of attributes is empty or 
not? The way it's right now, you get:

node:= (XMLElement new) name: 'foo';
     setAttributes: (Dictionary new);
     yourself.

=> '<foo></foo>'

even when running 'non-canonical' (due to 'self attributes isEmpty not' 
failing).

Cheers,
   - Andreas



More information about the Squeak-dev mailing list