Well to avoid back-compability issues it could be an optional, with default state to be back compatible.
On Sun, Jan 18, 2015 at 11:26 PM, Mark Overmeer <[email protected]> wrote: > * hmepas ([email protected]) [150118 15:11]: > > When I send soap-requests from XML::Compile i could use structres like > > { array_element => 'something' } > > Where array_element defined with maxOccur > 1. And XML::Compile will > > quietly treat it as [ 'something' ] provided. In my practice, if I as a > > programmer providing scalar where array ref expected it's most of the > time > > just honest mistake, like @values beside \@values, and for me would be > more > > expected behaviour is to just have errors then this happens. > > The writer offers a little more flexibility than the reader. In this > case: <element name="item" type="string" minOccurs="unbounded"/> > the reader will always produce item => ['foo'] > but the writer with accept both item => ['foo'] as item => 'foo' > > . Very very often, the schema permits to include more than one element, > but it is never used with more than one element. Those additional > array [] make the code less readible. > > . I have seen elements change over schema versions from default > maxOccurs=1 into maxOccurs > 1. In this case, the offered > flexibility helps: the old code works with the new schema. > > . It's quite confusing that the 'item' is signular, but you always > have to give it an array. It has bitten me a few times until > I had enough of it. > > So: the flexibility is on purpose and does help coders. It is not > accidental. > > I will not change the code for the simple reason of backwards > compatibility. I'll only break that when the code produces > incorrect results. > -- > Regards, > > MarkOv > > ------------------------------------------------------------------------ > Mark Overmeer MSc MARKOV Solutions > [email protected] [email protected] > http://Mark.Overmeer.net http://solutions.overmeer.net > > -- Pavel S. Khmelinsky <[email protected]> Jabber: [email protected] Skype: hmepas
_______________________________________________ Xml-compile mailing list [email protected] http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile
