469,304 Members | 1,803 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,304 developers. It's quick & easy.

Converting .txt to xml format

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
5 11453
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
"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
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
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
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.

Similar topics

1 post views Thread by Jonny Au | last post: by
3 posts views Thread by nvx | last post: by
3 posts views Thread by Jef Driesen | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.