[Xml-compile] XML::Compile v0.91

Drew Taylor drew at drewtaylor.com
Wed Aug 6 10:21:53 BST 2008


On 6 Aug 2008, at 09:33, Mark Overmeer wrote:

> * Mark Overmeer (mark at overmeer.net) [080805 22:35]:
>> * Drew Taylor (drew at drewtaylor.com) [080805 14:07]:
>>> I think I've come across a bug in 0.91 regarding minOccurs. I've  
>>> tried
>>> to simplify down things as much as possible w/o removing the  
>>> possible
>>> sources of trouble.
>>
>> I'll investigate it tomorrow.
>> Does it work if you change maxOccurs="5" into maxOccurs="unbounded"
>> in both cases?  Those are different optimization paths.
>
> Probably your problem is fixed with this change
> XML/Compile/Translate/Writer.pm line 291
>
>    my $opt = $max - $min;
>    sub { my ($doc, $values) = @_;
>          my @values = ref $values eq 'ARRAY' ? @$values
>                     : defined $values ? $values : ();
>
>          ( (map { $required->($doc, shift @values) } 1..$min)
>          , (map { $optional->($doc, shift @values) } 1..$opt)
> +        , undef
>          );
>        };
>
> Same fix needed at line 274

That did the trick! Thanks for the quick turnaround. :-)

Drew



More information about the Xml-compile mailing list