Open narayanamurthy opened 9 years ago
Can you paste your marshalling model configuration ?
Dear Yann Eugoné,
I am really sorry to say that I really do not know about "marshallong entities configuration".
Kind Regards, Narayana Murthy
On Wed, Dec 3, 2014 at 2:32 PM, Yann Eugoné notifications@github.com wrote:
Can you paste your marshallong entities configuration ?
— Reply to this email directly or view it on GitHub https://github.com/Level42/NotJaxbBundle/issues/16#issuecomment-65374646 .
Ok, this Bundle is trying to achieve XML to object mapping, so it can help you building the (de)serialization (called marshalling and unmarshalling) rules of your objects to(from) XML.
But the bundle is not able to do this without some configuration...
Please read the doc
Thanks for the reply. I understand that the Bundle is not able to convert( Marshall ) object into XML. But where can I change the configuration in this library.
This Bundle IS able to :
With the class :
namespace My\Bundle\Model;
use Level42\NotJaxbBundle\Annotation as Marshall;
/**
* @Marshall\XmlObject(name="email")
*/
class Email
{
/**
* @Marshall\XmlElement(name="Subject")
*/
protected $subject;
/**
* @Marshall\XmlElement(name="ToAddresses")
*/
protected $toAddresses;
}
You can get such a XML :
<email>
<Subject>Test mail</Subject>
<ToAddresses>test@gmail.com,rest@gmail.com</ToAddresses>
</email>
If
the email class looks like this
/* * @Marshall\XmlValue / protected $email_value;
Now when i am trying to set
Ok, if I understand your need, you got such a XML ?
<email>
testemail@test.com
<Subject>Test mail</Subject>
<ToAddresses>test@gmail.com,rest@gmail.com</ToAddresses>
</email>
No I do not have an xml like that. But I'm using different xmls which have common Tags.
Like in 1st xml
in 2nd xml
and I created class for "email" depending on the above two xmls. And i got stuck here.
On Wed, Dec 3, 2014 at 4:35 PM, Yann Eugoné notifications@github.com wrote:
Ok, if I understand your need, you got such a XML ?
testemail@test.com Test mail test@gmail.com,rest@gmail.com — Reply to this email directly or view it on GitHub https://github.com/Level42/NotJaxbBundle/issues/16#issuecomment-65391445 .
Ok, I will have a look and try to reproduce to your issue later.
You can try using XmlRaw until we found a solution.
So, I tested your use case, and I got the same problem. I think that this is caused by XmlValue, overriding the XML content within the marshalling process.
I created a new branch.
@fperinel what do you think we can do for this ?
I'm having a problem while preparing XML. If a tag contains both the sub-tags and value( yeah i have different XMLs ) and when i'm trying to set sub-tags it doesn't work and it only sets attributes or value not the sub-tags.
Here is the example from two XMLs.