xsi:nil self-closing elements not possible
Opened this issue · 0 comments
lukebeer commented
Issue raised via email in quote block below -
We have come up across a strange one however, we cannot generate a “xsi:nil” value in the API requests.
<BroadsoftDocument protocol="OCI" xmlns="C" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <userId xmlns="">marc.decorny</userId> <command xsi:type="UserModifyRequest17sp4" xmlns=""> <userId>xxxxxxx</userId> <phoneNumber>xxxxxxx</phoneNumber> <extension>202</extension><sipAliasList xsi:nil="true"/> <endpoint xsi:nil="true"/> </command> </BroadsoftDocument>
We have tried variants of the below, but keep on getting errors
$request->endptoint = new SimpleContent("xsi:nil"); $request->endptoint->setElementName('endpoint'); $request->endptoint = null ; $request->endptoint->setElementName('endpoint');But none seem to work.
Is there a trick that we are missing?
Many thanks
marc
Well spotted.
https://github.com/lukebeer/broadworks-ocip/blob/v1.0.0/core/OCIBuilder.php#L47 solved this in v1 but it's a bit of a hack. I'd planned to add methods that would handle element attributes but only got as far as declaring a variable named $attributes in the type trait ^_^