Deserialzation (XML) of multiple occurrences of the same tag under the root using JMS Serialization

StackOverflow https://stackoverflow.com/questions/20568388

Question

I'm trying to de-serialize the following using the jmsserializerbundle in symfony2:

   <root>
      <Tag></Tag>
      <Tag></Tag>
      <Tag></Tag>
      ...
   </root>

Since the root node is essentially the parent container for the multiple occurrences of Tag,de-serialization appears impossible.

   /**
    * @XMLRoot("root")
    */
   class root {

       /**
        * @Type("ArrayCollection<string>")
        */
       private $Tag;
   }

How can this be done?

Was it helpful?

Solution

Fixed.

This behaviour was added/fixed in the 0.13 branch

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top