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

working with java with XML

 
Chaveen Ekanayake
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ve heard that XML is easier and convenient than database connection for smaller programs. But I dont know how to store, edit, delete, data in a XML file. Please help me
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, I think that XML is a poor substitute for a database for any size program.
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chaveen, what exactly is your requirement?

As Bear says XML is not a substitute for a database.
 
arulk pillai
Author
Ranch Hand
Posts: 3388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
XML is good for exchanging data between two systems. If you really need to store in an XML, look at DOM Parser, JAXP, JiBX etc.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are plenty of XML and Java tutorials.

Harold has placed this massive and very complete book on line for your reference. It is loaded with examples. You will also need to get familiar with the standard Java library JavaDocs for XML related packages.

Bill
 
Chaveen Ekanayake
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am designing a chat program. I thought a database is too much for a chat program. Is that wrong?? should I use sql
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't think that a chat facility needs any long term storage. If it's the messages that you want to archive, you might consider plaintext files (not XML), since they never change.

Make sure the users of the chat know that their conversations are being stored; that might make it a non-starter for quite a few people.
[ September 15, 2008: Message edited by: Ulf Dittmer ]
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chaveen,
Have you had a look at XMPP (also called Jabber)?

XMPP is an XML protocol for Messaging and Prescence (XMPP = Extensible Messaging and Presence Protocol)

There should be free and open source client libraries and chat servers available for the XMPP protocol. Check here for one example.

On ways to parse XML, you might want to look at StAX too to see whether it suits your requirements.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic