This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes How to get string portion of mixed content with JAXB? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to get string portion of mixed content with JAXB?" Watch "How to get string portion of mixed content with JAXB?" New topic
Author

How to get string portion of mixed content with JAXB?

L Duperval
Ranch Hand

Joined: May 14, 2003
Posts: 63
Hi,

I have data with mixed content that looks like this:

<node attr1="1" attr2="1">I want this text only!
<otherNode attr="1" >3</otherNode>
<otherNode attr="2" >9</otherNode>
<otherNode attr="3" >9</otherNode>
<otherNode attr="4" >E</otherNode>
<otherNode attr="5" >4</otherNode>
<otherNode attr="6" >7</otherNode>
<otherNode attr="7" >0</otherNode>
</node>

Using JAXB, is there a way for me to get the String "I want this text only!" with everything else discarded?

I have this situation for a number of the elements in the XSD and I can't rewrite the spec. :-(

Thanks,

L


Live Free, Live Happy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get string portion of mixed content with JAXB?
 
Similar Threads
why println doesnt work in JSP?
Why is this happening?
mock question
Automatic Population of Indexed Fields
Displaying DOM using swing