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 '>' --> '>').
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!