[Linkbat-devel] XML Validation
Brought to you by:
jimmo
From: James M. <lin...@ji...> - 2002-11-22 10:10:44
|
HI All! Luu is now done with the CSV->XML conversion code and he can now start working on the validation code. I see the validation as a two step processs, both in terms of coding and the actual work. The first thing is to make sure we have a valid XML file, based on the not-yet-defined DTD. Even without the DTD, the principles are clear (I hope). A validation/check programm would look to make sure that all tags that are supposed to have a match have one, all tags that are supposed to be there are there and so on. For example, we decided that each answer should have the Reason tag pair, even if was empty. If not, the validation program will report it. Specific tags can only have certain attributes, like the Command type cannot have url="" attribute. The second step, which I see for sometime in the future is a validation of the data. For example, a future version could check to make sure that references are made only to KUs that are defined elsewhere. That would require reading in all of the KUs first, and would basically be the same code as the parse without the ouput. However, the parsing code will need to know about all KUs before it begins to write the indexes/cross-references. If there is a reference to a KU that does not exist, what should it do, report it and move on. We **could** have an option that simply runs through the process without writing it, as well as an option to check first and then write if things are okay. Comments? What concerns me is that a validation will require a full parse of the file, similar to the parse/export routines (to CSV or DB). The question is how much of the code will be the same? I would hate Luu to work on code that is duplicated in the parse and export routines. Luu, one thing you might want to check is to see if there are any perl modules for XML validation on www.cpan.org. I found a number of XML modules when I looked a couple of weeks, ago, but I cannot remember if there was anything about validation. Rama, are you there? Have you had done anything yet. I realize that you don't have the finished XML files (I'll get them done this weekend thanks to Luu's code). I'm just curious what you have done. Maybe we can combine the work in order to reduce the amount code and the time. Regards, jimmo -- --------------------------------------- "Be more concerned with your character than with your reputation. Your character is what you really are while your reputation is merely what others think you are." -- John Wooden --------------------------------------- Be sure to visit the Linux Tutorial: http://www.linux-tutorial.info |