Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8491939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:34:33+00:00 2026-06-10T22:34:33+00:00

my question is: from the xml scheme : <topnode> topNodeValue <bottomnode/> </topnode> generated class

  • 0

my question is: from the xml scheme :

<topnode>
    topNodeValue
   <bottomnode/> 
</topnode>

generated class with Jaxb looks like

class topnode {
    List<bottomnode> bottomnodeList;
}

Which does not generate the value field to set value for topnode.

How can I acheive this? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:34:35+00:00Added an answer on June 10, 2026 at 10:34 pm

    When the contents of an element contain both character and element data it is called mixed content. In JAXB (JSR-222) this is mapped with the @XmlMixed annotation like:

    class topnode {
        @XmlMixed
        String text;
    
        List<bottomnode> bottomnodeList;
    }
    

    The use of mixed content can be tricky, since you may get unexpected results due to text nodes used for formatting. For a more detailed explanation see the following answer to a similar question.

    • https://stackoverflow.com/a/11099303/383861
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked this question before: Generate XML from a class I want to do
I found another similar question: Best way to download images from XML content in
I was looking at this question: How to remove duplicate elements from an xml
Question from an exam: Given a linked list with unknown size n , where
I've got an XSD schema which I've generated a class for using xsd.exe, and
I'm working with a complicated xml schema, for which I have created a class
I have to unmarshal and process XML from an external system over which I
I'm working with javax.swing to make an aplication which generates forms from XML Schema
I'd like to extract an XML schema from a database (a database schema) using
I'm working on a XML Editor which gets all his information from the corresponding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.