The DF_Xero library used array2xml
to produce the XML for Xero objects. This chokes on data objects that contain lists of multiple sub-objects. Examples include the <Addresses>
and <Phones>
elements when creating a new Xero contact.
With this change, a flat array (no keys, or numeric keys) can be supplied as part of a data object. The parent element name will be singularized to provide the XML subelement names.
e.g.
[
'Addresses' => [
{address data array},
{address data array}
]
]
==>
<Addresses><Address>{address data}</Address><Address>{address data</Address></Addresses>
None
None
62c34e40a5c06ad29c4242630c98d059072e3537
in the National Weighing Xero integration project, but might be easier to OTS it at first opportunity.