Hi,
I am a newbee and have a comma seperated flat-file and a DTD. I need to
write a C# program which will read the text file and convert it to a
XML file as per the the definition in the DTD. I am not able to find
anything help-ful and don't know how to begin to code.
Can anyone please help me?
Thanks in advance
Ashoo Sharda
How much of a newbie are you? I will assume that you don't know much,
my apologies of I am wrong.
Most newbies make the mistake of trying to write too much at once.
Avoid this by writing a little and then testing it. Only go on when
all the tests work.
Start by writing a smell program to open a file and copy its contents
to the screen. Yes, that simple. It is something you will need to do
as part of your overall program so you might as well start with that.
Test it with different test files to check that it works.
Now add to your program so that it writes a second copy of the
original file to disk, with a new name. Again this is something you
will need to do in your overall program. Test it and check that you
are indeed making a copy of the input file.
Read your C# and XML books so you understand what C# can offer you as
built-in XML handling as part of .NET
Now try a very simple DTD and equivalent CSV file. Read in the DTD
and the CSV file, produce the XML file. Check that the XML file is
what you expect.
As required add extra processing to your program so that you can
process more and more complex DTD/CSV files. After each incremental
improvement test to make sure that your program still works correctly.
If you get stuck then post what you have written so we can have a look
at it. It lets us help you more of we can see your code.
rossum