Advertisement
Guest User

Untitled

a guest
Dec 16th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. Enigma2 and Vaders EPG
  2.  
  3. As I reported, Enigma2 (modern) systems use OE Alliance based software have trouble XML parsing unescaped HTML entities.
  4.  
  5. The parser is Python 2.x and falls into the same issue as reported at https://stackoverflow.com/questions/7237466/python-elementtree-support-for-parsing-unknown-xml-entities
  6.  
  7. The p2.xml generator (<tv source-info-name="vaders.tv" generator-info-name="VaderEPG" generator-info-url="vaders.tv">) uses a bunch of those HTML entities that seem to create problems/are unknown to the parser (acute, grave, circ, tilde, cedil, slash, dash, uml, zlig, etc...)
  8.  
  9. The p2.xml.gz generator (<tv source-info-name="vaders.tv" generator-info-name="VaderEPG" generator-info-url="epg.ninja">) apparently doesn't have said issues, as they use numeric HTML entities (e.g., &#233), although this isn't guaranteed: that file seems to have very few listings, namely it's missing the UK bouquet.
  10.  
  11. Other providers, simply escape HTML entities in the XML output, e.g., &eacute; becomes &amp;eacute; - I have this solution working with a small sed script to do such replacement inline (apparently, &amp; doesn't cause issues to the Python XML parser, fortunately) - the display in Enigma2 EPG is still crap, as the escaping is then removed and we're left with &eacute; but at least the events are parsed and displayed otherwise correctly. Not sure how this would interfere with other platforms you folks support, though.
  12.  
  13. Some solutions highlighted in the URL above, is just to define the HTML entities in the output as empty, although this isn't very elegant, e.g., <!ENTITY nbsp ' '> - again, not sure this would mess the other platforms.
  14.  
  15. Fixing the parser on the Enigma2 side would be the more elegant solution, but unfortunately Python in general seems to be craptastic on this and most of the solutions pointed on the stackoverflow URL won't work (as also documented on the article comments).
  16.  
  17. Happy to test whatever you folks come up with, if anything, thanks in advance.
  18.  
  19. @oottppxx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement