XmlElement name attribute not working #26

Open
jeffreylasut opened this Issue Aug 1, 2012 · 0 comments

Comments

Projects
None yet
1 participant

use Doctrine\OXM\Mapping as OXM;

/**
 * @OXM\XmlEntity
 */
class ObjectA {

/**
 * @OXM\XmlElement(type="ObjectB", name="hello")
 */
private $hello;

/**
 * @OXM\XmlElement(type="ObjectB", name="hello2")
 */
private $hello2;

.....

}

/**
 * @OXM\XmlEntity
 */
class ObjectB {

/**
 * @OXM\XmlText(type="string", name="hi1")
 */
private $hi1;

/**
 * @OXM\XmlText(type="string", name="hi2")
 */
private $hi2;

.....

}

I was expecting the following output using method marshalToString():

<object-a>
   <hello>
      <hi1>
      </hi2>
   </hello>
   <hello2>
       <hi1>
       </hi2>
   </hello2>
</object-a>

But I'm getting this:

<object-a>
   <object-b>
      <hi1>
      </hi2>
   </object-b>
   <object-b>
       <hi1>
       </hi2>
   </object-b>
</object-a>

I'm using the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment