Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAXB issue: how to convert List<Serializable> to String

 
hemamalini nithyanandam
Ranch Hand
Posts: 51
Chrome Eclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an xsd schema


and XML


i used JAXB parser and genarated a class



i am able to get the values using ValueObj.getContent() when


but i am getting an object for filename. how to read string from List<Serializable> when
 
Greg Charles
Sheriff
Posts: 2993
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks to me like you're having an issue with the way JAXB generates classes based on the schema. I'm going to move this into our XML forum, and enhance your subject line a bit for clarity.
 
g tsuji
Ranch Hand
Posts: 672
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For each ValueType object you've got (I suppose you have arrived at that stage no problem from the wording of your question), you can do this to get all the data you seem to be interested in retrieving.

Since it is of mixed content type, the empty string (after trim()) will be picked up as well if there really isn't any text node directly under value tag. You just have to screen the data further as needed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic