java - How can I add an attribute to a text element in JAXB? -


how can produce following xml fragment using jaxb?

<sequence md5="1de2cf633901ff1f00785735c8ce7e70">mptinsalrkvarvrltsg</sequence> 

my class follows:

@xmltype(name = "sequencetype") public class sequence {      private string md5;     private string sequence;      @xmlattribute     public string getmd5() {         return md5;     }      // jaxb annotation here??     public string getsequence() {         return sequence;     }  } 

@xmlvalue on sequence property.

@xmltype(name = "sequencetype") public class sequence {      private string md5;     private string sequence;      @xmlattribute     public string getmd5() {         return md5;     }      @xmlvalue     public string getsequence() {         return sequence;     }  } 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -