Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Invalid XML when exporting multi-episode files
#1
Hi,

this is a mix of a bug report and feature request. If there is a more appropriate sub-forum, please let me know and move this thread.

Description
Kodi is able to read episode files that contain more than one episode, i.e. multi-episodes (see https://kodi.wiki/view/Naming_video_file...i-Episodes )
An example for this would be S01E01-S01E02.mov.
When I export my library (Settings -> Media -> Export library) to get *.nfo files, the generated NFO is technically invalid.

Why are some NFO files invalid?
Because NFO files are actually just XML files (which is why every NFO file begins with "<?xml version="1.0" ... ?>") they must only contain 1 root element.
Kodi however simply concats <episodedetails> tags for all episodes in one file. This means that there are multiple root elements which is not correct.

What does the XML standard say?
https://www.w3.org/TR/REC-xml/#NT-document states:
Quote:There is exactly one element, called the root, or document element, no part of which appears in the content of any other element.

What consequences does this have?
XML libraries that stick to the specification are not able to correctly parse the NFO file. This includes QDomDocument of the Qt framework.

Workarounds
For example MediaElch simply adds a "fake" root element around all <episodedetails> tags to conform to the XML standard.
This is actually just string insertion (see code on GitHub).

Kodi Wiki
Kodi's wiki is also inconsistent (I think), see https://kodi.wiki/view/NFO_files/TV_show...isode_Tags
The text says:
Quote:For multi-part episodes, simply add multiple <episodedetails> XML blocks in succession.
However the table states for <episodedetails> -> multiple: No

Request
If feasible, I would like Kodi to add a single root element around all <episodedetails> tags, e.g. <episodes> or similar.

I didn't find a similar issue in  this forum or on GitHub, yet.

Regards,
Andre

PS: I didn't know whether I should post this issue on GitHub or not. So here it is :-)
Edit: I'm using Kodi v18.3 but this issue exist in v17 and v16 as well.
Reply
#2
My personal opinion is it's a bug (per your description) and should be entered as an issue.

scott s.
.
Reply
#3
(2019-08-17, 17:57)bugwelle Wrote: PS: I didn't know whether I should post this issue on GitHub or not. So here it is :-)

If something in Kodi is not working as advertised, then Github is exactly the place to be.

If Kodi is working properly, as in libraries are properly filled from nfo/xml files, then perhaps we may have bend the rules a little in this case. I'm sure it's one of those 'souvenirs from the past' when XBMC was being started.

I'm not sure if it is indeed easy to fix, adding a grouping tag for it sounds simple enough. But I'm not a Kodi developer.
Reply
#4
Ok, thanks. I have opened an issue on GitHub: https://github.com/xbmc/xbmc/issues/16506
Reply

Logout Mark Read Team Forum Stats Members Help
Invalid XML when exporting multi-episode files0