.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "ValidateFile 3pm" .TH ValidateFile 3pm 2024-02-24 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME XMLTV::ValidateFile \- Validates an XMLTV file .SH DESCRIPTION .IX Header "DESCRIPTION" Utility library that validates that a file is correct according to http://wiki.xmltv.org/index.php/XMLTVFormat. .SH "EXPORTED FUNCTIONS" .IX Header "EXPORTED FUNCTIONS" All these functions are exported on demand. .IP LoadDtd 4 .IX Item "LoadDtd" Load the xmltv dtd. Takes a single parameter which is the name of the xmltv dtd file. .Sp LoadDtd must be called before ValidateFile can be called. .IP ValidateFile 4 .IX Item "ValidateFile" Validate that a file is valid according to the XMLTV dtd and try to check that it contains valid information. ValidateFile takes a filename as parameter and optionally also a day and an offset and prints error messages to STDERR. .Sp ValidateFile returns a list of errors that it found with the file. Each error takes the form of a keyword: .Sp ValidateFile checks the following: .RS 4 .IP notwell 4 .IX Item "notwell" The file is not well-formed XML. .IP notvalid 4 .IX Item "notvalid" The file does not follow the XMLTV DTD. .IP invalidid 4 .IX Item "invalidid" An xmltvid does not look like a proper id, i.e. it does not match /^[\-a\-zA\-Z0\-9]+(\e.[\-a\-zA\-Z0\-9]+)+$/. .IP duplicateid 4 .IX Item "duplicateid" More than one channel-entry found for a channelid. .IP unknownid 4 .IX Item "unknownid" No channel-entry found for a channelid that is used in a programme-entry. .IP noprogrammes 4 .IX Item "noprogrammes" No programme entries were found in the file. .IP emptytitle 4 .IX Item "emptytitle" A programme entry with an empty or missing title was found. .IP emptydescription 4 .IX Item "emptydescription" A programme entry with an empty desc-element was found. The desc-element shall be omitted if there is no description. .IP badstart 4 .IX Item "badstart" A programme entry with an invalid start-time was found. .IP badstop 4 .IX Item "badstop" A programme entry with an invalid stop-time was found. .IP badepisode 4 .IX Item "badepisode" A programme entry with an invalid episode number was found. .IP missingtimezone 4 .IX Item "missingtimezone" The start/stop time for a programme entry does not include a timezone. .IP invalidtimezone 4 .IX Item "invalidtimezone" The start/stop time for a programme entry contains an invalid timezone. .IP badiso8859 4 .IX Item "badiso8859" The file is encoded in iso\-8859 but contains characters that have no meaning in iso\-8859 (or are control characters). If it's iso\-8859\-1 (aka Latin 1) it might be some characters in windows\-1252 encoding. .IP badutf8 4 .IX Item "badutf8" The file is encoded in utf\-8 but contains characters that look strange. 1) Mis-encoded single characters represented with [EF][BF][BD] bytes 2) Mis-encoded single characters represented with [C3][AF][C2][BF][C2][BD] bytes 3) Mis-encoded single characters in range [C2][80\-9F] .IP badentity 4 .IX Item "badentity" The file contains one or more undefined XML entities. .RE .RS 4 .Sp If no errors are found, an empty list is returned. .RE .SH BUGS .IX Header "BUGS" It is currently necessary to specify the path to the xmltv dtd-file. This should not be necessary. .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (C) 2006 Mattias Holmlund. .PP This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .PP You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110\-1301, USA.