in reply to excel to xml conversion and then comparison with another XML

In my opinion Perl should be used to test if MS Excel is producing valid XML, not the other way around.

If you like to test your script output, which is a noble thing, then I would code the reference XML either by hand or take a more standard tool for it then Excel.

You can compare both XML like you said. I would use XML::Simple to read both XML files into separate hashes which can that be compared. Test::More gives you the function is_deeply to do this, but I'm not sure if you can easily use it in a non-Test Perl script. On the other hand your script is basically one.

Replies are listed 'Best First'.
Re^2: excel to xml conversion and then comparison with another XML
by Anonymous Monk on Apr 24, 2008 at 09:08 UTC
    Do you mean to convert the xml file which is generated as a output of perl script to excel. Then compare both the spreadsheets i.e. the spreadsheet which I created manually with the one converted from xml. will this be more convinient than comparing 2 xmls?
      No, comparing the two XML files would be better. My point was that you take the XML generated by Excel as reference, i.e. you assume that Excel will produce correct, valid XML and differences to the Perl XML would mean that the Perl script made an error. I personally trust the Perl XML generator more than Excel. So I would take the Perl XML output as reference if Excel is generating correct XML.

      But don't start a Linux/Windows or Perl/MS Office flame war here ... you can use the modules I mentioned in my last post to compare the two XMLs, you just have to critical interpret the results.