1

I want to Copy an xml file from one directory to other directory. I've used Files.copy(source, target, REPLACE_EXISTING).But i am getting it as a text file.I want it as xml. Please help.

pparitala
  • 33
  • 6

1 Answers1

0

In case you are asking: "I got a text file A.txt in one directory, and I want to represent the content of that file as some B.xml in another directory" ... well, then simple: you will have to

  1. parse that text file (identify the information within)
  2. decide how to "model" that in an XML like document structure
  3. write that as XML

There is simply no generic way of transforming any kind of "text" into XML.

GhostCat
  • 137,827
  • 25
  • 176
  • 248