[haXe] Bugfix proposal: RMulti case in haxe.xml.Check.hx

Nicolas Cannasse ncannasse at motion-twin.com
Tue Apr 24 16:37:02 CEST 2007


> Hi Nicolas,
> 
> The RMulti rule did not work properly for me. After some digging into
> haxe.xml.Check.hx I found that the following bugfixes ensure proper
> validation of an XML against a rule that includes an RMulti rule.
[...]
> The problem with the previous version was that the case RMulti
> stumbled across the PCData element that every XML element has. That
> element was submitted to checkList() and was then found as being
> empty. So the first fix was to insert the isBlank() check.
> 
> The second bugfix was to move the check for the ?atLeastOne flag after
> the for loop and checking whether at least one non-blank element was
> returned by the iterator (instead of it.hasNext() which also returns
> true if the iterator returns a blank element).

Thanks, that makes a lot of sense.

Patch applied.

Nicolas



More information about the Haxe mailing list