AABoyles / LessWrong-Portable

Make EBooks from LessWrong 2.0 and other sources of interest to the aspiring rationalist community
https://github.com/AABoyles/LessWrong-Portable/blob/master/README.md#lesswrong-portable
41 stars 8 forks source link

Chapter template and XML schema errors #18

Open gavento opened 4 years ago

gavento commented 4 years ago

While building the ebook multi-agent-model with the current version (086aca65f389641701000253f05124e45d94475f), the epub is not a valid XML which breaks my reader (OReader at C-Tech Lexis; works for ~99% other epubs).

The issues reported by Calibre book editor (in calibre: edit imported book -> check book) are abount an undefined namespace. Indeed the header of chapter files is:

<html xmlns="http://www.w3.org/1999/xhtml"><head/><body><section epub:type="chapter" id="chapter">
    <!-- Your contents here -->
  <h1>Against "System 1" and "System 2" (subagent sequence) </h1><div><p>The terms System 1 and System 2 [...]

This is weird since the template for a chapter (templates/chapter.xhtml) has a different structure and does declare the namespace ... Perhaps the template is not used, or the EPUB library silently does something weird to it afterwards?

Errors from calibre. Manually removing the namespace epub: fixed this for my reader.

ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-10.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-11.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-12.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-13.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-14.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-15.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-16.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-17.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-18.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-2.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-3.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-4.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-5.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-6.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-7.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-8.xhtml]
ERROR: Parsing failed: Namespace prefix epub for type on section is not defined, line 1, column 98    [OEBPS/chapter-9.xhtml]
AABoyles commented 4 years ago

Thanks @gavento! Looking in to it...