<div dir="ltr">Well to avoid back-compability issues it could be an optional, with default state to be back compatible.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 18, 2015 at 11:26 PM, Mark Overmeer <span dir="ltr"><<a href="mailto:mark@overmeer.net" target="_blank">mark@overmeer.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">* hmepas (<a href="mailto:hmepas@gmail.com">hmepas@gmail.com</a>) [150118 15:11]:<br>
<span class="">> When I send soap-requests from XML::Compile i could use structres like<br>
> { array_element => 'something' }<br>
> Where array_element defined with maxOccur > 1. And XML::Compile will<br>
> quietly treat it as [ 'something' ] provided. In my practice, if I as a<br>
> programmer providing scalar where array ref expected it's most of the time<br>
> just honest mistake, like @values beside \@values, and for me would be more<br>
> expected behaviour is to just have errors then this happens.<br>
<br>
</span>The writer offers a little more flexibility than the reader. In this<br>
case: <element name="item" type="string" minOccurs="unbounded"/><br>
the reader will always produce item => ['foo']<br>
but the writer with accept both item => ['foo'] as item => 'foo'<br>
<br>
. Very very often, the schema permits to include more than one element,<br>
but it is never used with more than one element. Those additional<br>
array [] make the code less readible.<br>
<br>
. I have seen elements change over schema versions from default<br>
maxOccurs=1 into maxOccurs > 1. In this case, the offered<br>
flexibility helps: the old code works with the new schema.<br>
<br>
. It's quite confusing that the 'item' is signular, but you always<br>
have to give it an array. It has bitten me a few times until<br>
I had enough of it.<br>
<br>
So: the flexibility is on purpose and does help coders. It is not<br>
accidental.<br>
<br>
I will not change the code for the simple reason of backwards<br>
compatibility. I'll only break that when the code produces<br>
incorrect results.<br>
<span class="HOEnZb"><font color="#888888">--<br>
Regards,<br>
<br>
MarkOv<br>
<br>
------------------------------------------------------------------------<br>
Mark Overmeer MSc MARKOV Solutions<br>
Mark@Overmeer.net <a href="mailto:solutions@overmeer.net">solutions@overmeer.net</a><br>
<a href="http://Mark.Overmeer.net" target="_blank">http://Mark.Overmeer.net</a> <a href="http://solutions.overmeer.net" target="_blank">http://solutions.overmeer.net</a><br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div>Pavel S. Khmelinsky <<a href="mailto:hmepas@gmail.com" target="_blank">hmepas@gmail.com</a>></div><div>Jabber: <a href="mailto:hmepas@gmail.com" target="_blank">hmepas@gmail.com</a></div><div>Skype: hmepas</div></div>
</div>