<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">&lt;<a href="mailto:mark@overmeer.net" target="_blank">mark@overmeer.net</a>&gt;</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="">&gt; When I send soap-requests from XML::Compile i could use structres like<br>
&gt; { array_element =&gt; &#39;something&#39; }<br>
&gt; Where array_element defined with maxOccur &gt; 1. And XML::Compile will<br>
&gt; quietly treat it as [ &#39;something&#39; ] provided. In my practice, if I as a<br>
&gt; programmer providing scalar where array ref expected it&#39;s most of the time<br>
&gt; just honest mistake, like @values beside \@values, and for me would be more<br>
&gt; 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:    &lt;element name=&quot;item&quot; type=&quot;string&quot; minOccurs=&quot;unbounded&quot;/&gt;<br>
the reader will always produce   item =&gt; [&#39;foo&#39;]<br>
but the writer with accept both  item =&gt; [&#39;foo&#39;]  as  item =&gt; &#39;foo&#39;<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 &gt; 1.  In this case, the offered<br>
   flexibility helps: the old code works with the new schema.<br>
<br>
 . It&#39;s quite confusing that the &#39;item&#39; 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&#39;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 &lt;<a href="mailto:hmepas@gmail.com" target="_blank">hmepas@gmail.com</a>&gt;</div><div>Jabber: <a href="mailto:hmepas@gmail.com" target="_blank">hmepas@gmail.com</a></div><div>Skype: hmepas</div></div>
</div>