By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,737 Members | 1,971 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,737 IT Pros & Developers. It's quick & easy.

Converting .txt to xml format

P: n/a
I am a student and I have to make a java program that converts a .txt
file to xml format. Has anyone previous experience at that problem?
What methods are appropriate? Is there anywhere free code? Any ideas?
I want my program to convert simple .txt files to well-formed (or not,
if it is very difficult), not something very special. I am a novice in
Java (as student), so try to explain every answer! Thanks a lot!
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Have a look at this ebook:

http://www.cafeconleche.org/books/xmljava/

I think it will have everything you need to accomplish your goals.

"ptoum" <pt*******@mail.gr> wrote in message
news:26*************************@posting.google.co m...
I am a student and I have to make a java program that converts a .txt
file to xml format. Has anyone previous experience at that problem?
What methods are appropriate? Is there anywhere free code? Any ideas?
I want my program to convert simple .txt files to well-formed (or not,
if it is very difficult), not something very special. I am a novice in
Java (as student), so try to explain every answer! Thanks a lot!


Jul 17 '05 #2

P: n/a
"Patrick Thrapp" <co*******@garbage.dump> wrote in message news:<hg***************@nwrddc01.gnilink.net>...
Have a look at this ebook:

http://www.cafeconleche.org/books/xmljava/

I think it will have everything you need to accomplish your goals.


Thanks a lot! I had found a chapter of this book before I wrote the
message, but I thought, it was useless. I think I have to
reconsider...
Jul 17 '05 #3

P: n/a
Post a clip of the text file ...

pt*******@mail.gr (ptoum) wrote in message news:<26*************************@posting.google.c om>...
I am a student and I have to make a java program that converts a .txt
file to xml format. Has anyone previous experience at that problem?
What methods are appropriate? Is there anywhere free code? Any ideas?
I want my program to convert simple .txt files to well-formed (or not,
if it is very difficult), not something very special. I am a novice in
Java (as student), so try to explain every answer! Thanks a lot!

Jul 17 '05 #4

P: n/a
gi*******************@yahoo.com (GIMME) wrote in message news:<3f**************************@posting.google. com>...
Post a clip of the text file ...


I don't refer to a particular .txt file. I want a program that would
convert every simple .txt file to xml.
Jul 17 '05 #5

P: n/a
Well, it really depends on what the .txt file contains. Is it just
text, or is it supposed to have some structure?

If it's just text, with no particular structure, then I guess you could
"convert" it to xml by slapping start and end tags at the beginning and
end of the file respectively, and then escape all the characters in the
file that have special meaning in xml (for example '>' --> '&gt;').
Without more information on the contents of the file, this is about all
you can do.

If the files are in a particular form, you could parse it and creating a
meaningful xml file.

Hope this helps.

--Nathan Davis

ptoum wrote:
I am a student and I have to make a java program that converts a .txt
file to xml format. Has anyone previous experience at that problem?
What methods are appropriate? Is there anywhere free code? Any ideas?
I want my program to convert simple .txt files to well-formed (or not,
if it is very difficult), not something very special. I am a novice in
Java (as student), so try to explain every answer! Thanks a lot!


Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.