LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-12-2009, 09:17 AM   #1
manolakis
Member
 
Registered: Nov 2006
Distribution: xubuntu
Posts: 464

Rep: Reputation: 37
XML deserializer


Dear all,

I would like to ask you something that I have absolutely no idea how to do? I am actually writing my own XML de/serializer in Java. Given an object like the following:
Quote:

class person
{
public String name;
public int age;
}
and given the following XML file:

Quote:
<person>
<name>David</name>
<age>27</age>
</person>
the deserializer for instance can execute the following set of instructions in order to create the object:
Quote:
Person person = new Person();
person.name = "David";
person.age = 27;
I am now wondering how can I assign attribute values when they are declared as private? Does anybody know how traditional de/serializer work in such cases?

Thank you.
 
Old 05-12-2009, 09:25 AM   #2
kellinwood
Member
 
Registered: Jan 2006
Location: Culver City, California
Distribution: Fedora
Posts: 64

Rep: Reputation: 21
There are a variety of open-source software packages that solve this problem. You could obtain the source code to these projects and take a look.

Just to name a few:
  • xstream
  • castor-xml
  • xmlbeans
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
XML Schemas and Java XML Parsers manolakis Programming 1 03-20-2009 08:51 PM
LXer: Thinking XML: Firefox 3.0 and XML LXer Syndicated Linux News 0 07-30-2008 06:50 PM
no xml, convert tvtime stationlist to xml for mythtv/freevo... frenchn00b Linux - General 8 11-03-2007 11:35 PM
LXer: StAX’ing up XML: Streaming API for XML LXer Syndicated Linux News 0 11-30-2006 07:54 AM
configure: error: could not find DocBook XML DTD V4.1.2 in XML catalog Fadoksi Linux - Software 1 07-16-2006 06:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration