I’m trying to create an xml element which i want to have as prefix the atom.
I know that i can’t do this:
@XmlElement(prefix="atom")
And create
<XmlAttribute>
<atom:link ...>
</XmlAttribute>
Is there a possible way to do this or not?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you just need to define the namespace corresponding to this prefix:
this will just add the namespace corresponding to the
atomprefix to yourlinkelement. If your question is about specifically gettingatomas the prefix for this namespace, then please look at this question: Is it possible to customize the namespace prefix that JAXB uses when marshalling to a String?