Text file to XML
843834Dec 28 2004 — edited Dec 29 2004Hey,
I'm quite new to XML and have the following problem at hand: I have a text file containing a 1000 numbers one below the other. I also have a XML file that has a 'Data' element somewhere in the file. Each 'Data' element would correspond to one number from the text file. I would like to programatically read each number from the text file and create 1000 'Data' elements in my XML file. I would then like to parse the XML file to obtain each number (I guess I'd have to use JAXP/SAX for this?)
The above procedure is just for testing purposes. Eventually, there will not be a text file but a stream of data points getting fed straight into the xml file (dunno how yet, but that's later). But, for testing purposes with a text file...is the above approach ok, or is there some better way to do this?
Thank you.