An xmltv file is supposed to use the format specified in XmltvFileFormat. It is possible to validate that a file actually uses the correct format in a number of different ways.
Validation using tv_validate_file
To do this, you need to use XMLTV version 0.5.43 or later.
There is a tool called tv_validate_file. It checks that a file follows the xmltv dtd, as well as performs a number of other tests. See perldoc XMLTV::?ValidateFile for more details.
Usage: tv_validate_file <filename>
Validation using nsgmls
Use nsgmls for this, from [[http://openjade.sourceforge.net/][OpenSP]]. First you have to set some environment variables:
export SP_CHARSET_FIXED=YES
export SP_ENCODING=XML
export SGML_CATALOG_FILES=/usr/doc/jade-1.2.1/pubtext/xml.soc
The last one of these will depend on where xml.soc is on your system. Then to validate:
% nsgmls -wxml -s file.xml
If you're dealing with XMLTV format, you could also check that the file is identical after passing through tvcat (which will make sure whitespace etc. uses the same conventions as XMLTV apps - not strictly necessary but nice), and that sorting it th rough tvsort doesn't give any errors about overlapping programmes or other nonsense.