Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to deserialize content into property #35

Closed
michelsalib opened this issue Sep 27, 2011 · 2 comments
Closed

Make it possible to deserialize content into property #35

michelsalib opened this issue Sep 27, 2011 · 2 comments

Comments

@michelsalib
Copy link

Hi,
I would like to to deserialize this :

<offer>
    <cost currency="USD">0.00</shippingCost>
</offer>

Into these classes :

class Offer{
    /**
     * @Type("Price")
     */
    private $cost;
}

class Price {
    /**
     * @XmlAttribute
     */
    private $currency;

    /**
     * @Type("double")
     */
    private $price;
}

As you can see there is not attribute to tell that price should be the content of the xml node. So it would be very useful to have some kind of @XmlContent annotation to do this.

@schmittjoh
Copy link
Owner

That's something we should add, I would definitely welcome a patch for this (preferably with unit tests).

Regarding the naming of the annotation, do you mind if we use @XmlValue instead (that's what JSR-222 uses)?

@michelsalib
Copy link
Author

I am ok with the @XmlValue naming.

I'll try to find some time to submit a patch, but I don't do any promise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants