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

  • SEARCH
  • Home
  • 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 179797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:28:15+00:00 2026-05-11T14:28:15+00:00

What kind of open-source libraries are available to convert XML into a java value

  • 0

What kind of open-source libraries are available to convert XML into a java value object?

In .Net, there is a way to easily do this with xml serialization and attributes. I would imagine there some parallel in java. I know how to do this with a DOM or SAX parser, but I was wondering if there was an easier way.

I have a predefined XML format that looks something like this.

<FOOBAR_DATA>   <ID>12345</ID>   <MESSAGE>Hello World!</MESSAGE>   <DATE>22/04/2009</DATE>   <NAME>Fred</NAME> </FOOBAR_DATA> 

In .Net, I can do something like this to bind my object to the data.

using System; using System.Xml.Serialization;      namespace FooBarData.Serialization     {       [XmlRoot('FOOBAR_DATA')]       public class FooBarData   {     private int _ID = 0;     [XmlElement('ID')]     public int ID     {       get { return this._ID; }       set { this._ID = value; }     }      private string _Message = '';     [XmlElement('MESSAGE')]     public string Message     {       get { return this._Message; }       set { this._Message = value; }     }      private string _Name = '';     [XmlElement('NAME')]     public string Name     {       get { return this._Name; }       set { this._Name = value; }     }      private Date _Date;     [XmlElement('DATE')]     public Date Date     {       get { return this._Date; }       set { this._Date= value; }     }      public FooBarData()     {     }   } } 

I was wondering if there was a method using annotations, similar to .Net or perhaps Hibernate, that will allow me to bind my value object to the predefined-XML.

  • 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. 2026-05-11T14:28:16+00:00Added an answer on May 11, 2026 at 2:28 pm

    I like XStream alot, especially compared to JAXB – unlike JAXB, XStream doesn’t need you to have an XSD. It’s great if you have a handful of classes you want to serialize and deserialize to XML, without the heavy-handed-ness of needing to create a XSD, run jaxc to generate classes from that schema, etc. XStream on the other hand is pretty lightweight.

    (Of course, there are plenty of times where JAXB is appropriate, such as when you have a pre-existing XSD that fits the occasion…)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 93k
  • Answers 93k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It's very difficult to see what you have done there,… May 11, 2026 at 6:43 pm
  • Editorial Team
    Editorial Team added an answer EDIT: I originally missed the part that you have many… May 11, 2026 at 6:43 pm
  • Editorial Team
    Editorial Team added an answer Have you tried something like this? list1 = From t… May 11, 2026 at 6:43 pm

Related Questions

For an application I'm creating, I need to be able to read AAC and
I'm about to start developing a product (in .NET), and I'm evaluating open source
I'm interested in building a Texas Hold 'Em AI engine in Java. This is
If I was going to start an open source project using Python what version

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.