aspose file tools*
The moose likes XML and Related Technologies and the fly likes working with java with XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "working with java with XML" Watch "working with java with XML" New topic
Author

working with java with XML

Chaveen Ekanayake
Greenhorn

Joined: Jun 01, 2008
Posts: 14
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

Joined: Jan 10, 2002
Posts: 60997
    
  65

Personally, I think that XML is a poor substitute for a database for any size program.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 347
Chaveen, what exactly is your requirement?

As Bear says XML is not a substitute for a database.
arulk pillai
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3219
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.


Java Interview Questions and Answers Blog | Amazon.com profile | Java Interview Books
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
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

Joined: Jun 01, 2008
Posts: 14
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
Marshal

Joined: Mar 22, 2005
Posts: 41520
    
  53
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 ]

Ping & DNS - my free Android networking tools app
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 347
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: working with java with XML