Changes
Title
unchanged
REST API and null values in XML
Category
unchanged
Tips
Yii version
unchanged
Tags
unchanged
REST, XML, null
Content
changed
[...]
However this is not supported by the current implementation of XmlResponseFormatter because values are always appended as DOMText. This means that, even is I pass a PHP null value, I get `<elem></elem>`.
Therefore, I have extended XmlResponse Formatter as follows.
Firstly, the function format() must be modified because creating $root as DOMElement makes it immutable while I need to attach the xsi: namespace definition. Therefore I use:
```php[...]