[squeak-dev] Re: XMLParser weirdness
Bert Freudenberg
bert at freudenbergs.de
Tue Aug 10 20:15:35 UTC 2010
On 10.08.2010, at 22:08, Andreas Raab wrote:
> 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
I can't see the canonicalization having anything to do with attributes being present or not:
http://www.w3.org/TR/xml-c14n#Example-SETags
- Bert -
More information about the Squeak-dev
mailing list
|