XMLTV / xmltv

Utilities to obtain, generate, and post-process TV listings data in XMLTV format
GNU General Public License v2.0
297 stars 94 forks source link

tv_validate_file fails when a category is used #233

Closed damnms closed 5 months ago

damnms commented 5 months ago

Thanks for taking the time to report an issue. Please take a moment to review our open/closed issues above, in case your issue has already been reported.

If you are reporting a new issue, please give your issue a descriptive title and fill out the blanks below, providing as much information as possible.

XMLTV Version? 1.3.0-1

(Please specify release version or git commit ID) …

XMLTV Component?

tv_validate_file …

Perl Version

Operating System

debian trixie …

What happened?

i get an error …

What did you expect to happen?

no error …

Did you see any warnings/errors?

(Please paste any warnings/errors, if available)

oli@DESKTOP-RA0V02P:~/IdeaProjects/project$ tv_validate_file /home/oli/.config/JetBrains/IntelliJIdea2024.1/scratches/scratch.xml
The file is not valid according to the xmltv dtd:
 /home/oli/.config/JetBrains/IntelliJIdea2024.1/scratches/scratch.xml:19: validity error : Element programme content does not follow the DTD, expecting (title+ , sub-title* , desc* , credits? , date? , category* , keyword* , language? , orig-language? , length? , icon* , url* , country* , episode-num* , video? , audio? , previously-shown? , premiere? , last-chance? , new? , subtitles* , rating* , star-rating* , review*), got (title sub-title desc date language icon category category )

the .xml i used is:

<?xml version='1.0' encoding='utf-8'?>
<tv>
    <programme start="20240526173000+0000" stop="20240526180000+0000"
               channel="Eurosport1.de">
        <title lang="de">Roland Garros 2024</title>
        <sub-title lang="de">1. Runde</sub-title>
        <desc lang="de">Die Übertragung der French Open 2024 aus dem
            Stade Roland Garros in Paris, Frankreich.
        </desc>
        <date>2024</date>
        <language>de</language>
        <icon src="http://ngiss.t-online.de/cm1s/media/gracenote/2/4/p24986849_i_h9_aa_2024-01-26T16_23_05.jpg"/>

    </programme>

    <programme start="20240526040000+0000" stop="20240526060100+0000"
               channel="MTVGermany.de">
        <title lang="de">Breakfast Club</title>
        <sub-title lang="de"/>
        <desc lang="de">Die Sendung zeigt jeden Morgen die neuesten
            Musikvideos aus den aktuellen Charts.
        </desc>
        <date>2000</date>
        <language>de</language>
        <icon src="http://ngiss.t-online.de/cm1s/media/gracenote/5/9/p599800_i_h9_aa_2019-03-11T15_21_00.jpg"/>

        <category lang="en">Comedy</category>
        <category lang="en">Drama</category>

    </programme>

</tv>

What steps are needed to reproduce this issue?

(Please provide the full commands you are running)

  1. create the above .xml file
  2. tv_validate_file on that file
  3. the errors are shown

Please attach your config file below:

(Remember to remove any usernames/passwords) …

Any other information?

(For example, is this a new or intermittent issue?) … when i remove the category, i get no error. but i copied that category information from the official .dtd example

honir commented 5 months ago

The ordering of the elements is important. category must come before language and icon

expecting (title+ , sub-title* , desc* , credits? , date? , category* , keyword* , language? , 
orig-language? , length? , icon* , ...

Move category before language and your file will validate ok

(apart from the missing channel entities that is, and missing space before timezone offset)

damnms commented 5 months ago

oh, thanks for this clarification!

honir commented 5 months ago

No prob. Any other questions feel free to ask. :-)