JMS序列化器XmlList批注

Ale*_*lex 5 php xml annotations jms-serializer

如何为@XmlList元素定义cdata和名称空间?

例如,如果我需要修改示例http://jmsyst.com/libs/serializer/master/reference/annotations#xmlnamespace中的 BlogPost 以具有多个作者:

use JMS\Serializer\Annotation as JMS;

/**
 * @JMS\XmlNamespace(uri="http://example.com/namespace")
 * @JMS\XmlNamespace(uri="http://www.w3.org/2005/Atom", prefix="atom")
 * @JMS\XmlRoot("blog-post")
 */
class BlogPost
{
    /**
     * @JMS\Type("ArrayCollection<JMS\Serializer\Tests\Fixtures\Author>")
     * @JMS\XmlList(inline = true, entry="author")
     *
     * replaced XmlElement(namespace="http://www.w3.org/2005/Atom") with XmlList
     */
    private $author;
}
Run Code Online (Sandbox Code Playgroud)

具有类似以下内容的序列化xml:

<?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>
Run Code Online (Sandbox Code Playgroud)

对于单个@ XmlElement,cdata和名称空间都可以正常工作,但是@XmlList@XmlCollection没有这样的功能。

有什么线索我应该在列表中的元素的注释处放置什么?