Help with converting flat file information

Hi,

I am currently involved in a design process where a flat file is to be read and further processing be done on it and output generated. It is required that the input format not be changed into xml to maintain backward compatiblity. I proposed that converting the flatfile into dom. This way, if in future it is decided to drop backward compatiblity the processing logic need not be changed.

The contents of the flat file need to be validated for syntax correctness and then process the information. I proposed the use of dtd/schema to validate and then use XSL to produce output files depending on content.

The other appoach is to use class objects to read the information and use the objects for processing, thus not involving DOM, schema or XSL.

What is the best method to convert the flat file into DOM. I have used XSLT to transform XML into another XML but never worked with flat files. Is it possible to use XSL to transform a flat file into DOM? Is it an efficient way to process or is it better to not involve DOM at all and just use objects?

Any help will be appreciated.

Regards,

[1135 byte] By [presana] at [2007-10-3 4:34:11]
# 1
I'm not sure how you propose to use DTD or schema validation on something that isn't XML. But at any rate, to make a flat file into a DOM, you could use a SAX filter. Read about that here: http://www.cafeconleche.org/books/xmljava/chapters/ch08s05.html
DrClapa at 2007-7-14 22:37:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Thankx DrClap for ur reply. What I ment to convey was after I convert the flat file into DOM I could validate the DOM using schema or DTD. And thankx for the link.
presana at 2007-7-14 22:37:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
Hello everyone,Is it not possible to use xsl transformations to convert the falt file into DOM? I think it would be much more efficient using XSL tranformation then using Java DOM.Answers appreciated.Regards,
presana at 2007-7-14 22:37:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
XSLT file requires a XML file Document object as input.
dvohra09a at 2007-7-14 22:37:49 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...