How to define cdata and namespace for @XmlList elements?
For example, if I need to change BlogPost from the example http://jmsyst.com/libs/serializer/master/reference/annotations#xmlnamespace to have several authors:
use JMS\Serializer\Annotation as JMS;
class BlogPost
{
private $author;
}
with serialized xml similar to:
<?xml version="1.0" encoding="UTF-8"?>
<blog-post xmlns="http://example.com/namespace" xmlns:atom="http://www.w3.org/2005/Atom">
<atom:author>
<full_name>Foo Bar></full_name>
</atom:author>
<atom:author>
<full_name>Baz Qux></full_name>
</atom:author>
</blog>
For a single @XmlElement, both cdata and namespace work fine, but @XmlList and @XmlCollection have nothing of the kind.
Any clue where should I put annotation for items in a list?
source
share