09-20-2024, 05:24 PM | #1 |
Evangelist
Posts: 450
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
|
Unexpected empty source
The Check book function has marked every html file with Unexpected empty source and noted line 1 column 0.
The first few lines are Code:
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> BTW, this is a book in which just about every CSS entry is a calibre class. It's the Maude translation of War and Peace. Duke Classics is claiming a 2012 copyright. |
09-20-2024, 05:45 PM | #2 |
Resident Curmudgeon
Posts: 76,440
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Try this code instead.
Code:
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"> <head> Code:
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="en-US" xml:lang="en-US"> <head> Last edited by JSWolf; 09-20-2024 at 05:49 PM. |
Advert | |
|
09-20-2024, 05:57 PM | #3 |
Wizard
Posts: 1,357
Karma: 6794938
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
I don't think the issue is in the first line. More likely the checker is simply falling back to the first line and the problem is elsewhere on the page.
Can we see the entire page, or the entire book if available? Is it epub2 or epub3? |
09-20-2024, 06:06 PM | #4 |
Evangelist
Posts: 450
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
|
Here's the first html file:
Code:
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>War and Peace</title> <meta name="author" content="Leo Nikoleyevich Tolstoy"/> <meta name="generator" content="Duke Classics"/> <link href="stylesheet.css" type="text/css" rel="stylesheet"/><style type="text/css"> </style></head> <body class="calibre"> <h1 class="title" id="calibre_toc_1">WAR AND PEACE</h1> <h2 class="decoration">* * *</h2> <h2 class="decoration">LEO NIKOLEYEVICH TOLSTOY</h2><div class="calibre2" style="text-align:center"><em class="calibre3">Translated by</em></div><h2 class="decoration">AYLMER MAUDE</h2><h2 class="decoration">LOUISE SHANKS MAUDE</h2> <div class="center"><img src="logo_s.jpg" alt="Duke Classics" class="calibre4"/></div> <div class="calibre1" id="calibre_pb_2"></div></body> </html> EDIT: Alas, Jon's suggestions didn't help. Last edited by foosion; 09-20-2024 at 06:11 PM. |
09-20-2024, 06:16 PM | #5 |
Wizard
Posts: 1,357
Karma: 6794938
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Thanks.
PHP Code:
Delete that line and the error will be cleared. == Edit == You then need to relink the stylesheet to the html page. That will fix the error. Last edited by Karellen; 09-20-2024 at 06:25 PM. |
Advert | |
|
09-20-2024, 06:25 PM | #6 | ||
Evangelist
Posts: 450
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
|
Quote:
386 errors (one per part) seemed a bit much, even if it had no effect on the actual rendering of the book. Out of idle curiosity, I wonder why the Calibre editor didn't identify that line. Or why the publisher, which obviously used Calibre, didn't notice and fix it. Now I just have to decide if I want to read this translation or the Briggs version. Quote:
Last edited by foosion; 09-20-2024 at 06:33 PM. |
||
09-20-2024, 07:31 PM | #7 |
Bibliophagist
Posts: 40,549
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
|
09-20-2024, 08:05 PM | #8 |
Wizard
Posts: 1,357
Karma: 6794938
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
There are a few errors that don't go to the actual source of the error.
Even epubCheck shows the same behaviour at times. One that comes to mind is forgetting to add properties="svg" in the opf. epubCheck will tell you it is missing, but not take you to where it should be fixed. It won't even open the file. As for the publisher... some do weird things. Also, I'd rethink not linking the stylesheet. Calibre is quite forgiving with errors, ereaders may not be. For a 6 second job, I wouldn't even question it. I would just do it. |
09-20-2024, 08:13 PM | #9 | |
Evangelist
Posts: 450
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
|
Quote:
Based on some comments here I had thought epubcheck was more rigorous than Calibre editor's check, but I guess they're just different. |
|
09-20-2024, 08:26 PM | #10 | |
Evangelist
Posts: 450
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
|
Quote:
Turns out the stylesheet is in the same directory as the html files, so the current ref is correct. The change would be to move the stylesheet to ../styles, then link. |
|
09-20-2024, 08:40 PM | #11 |
Evangelist
Posts: 450
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
|
Every time I think I'm getting a handle on CSS and epub, something new, like this, turns up.
Thanks y'all for your patience as I learn how these things work. Last edited by foosion; 09-20-2024 at 09:49 PM. |
09-20-2024, 10:12 PM | #12 | |
Bibliophagist
Posts: 40,549
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Remember that epubcheck is specific to ePub while stylelint is (X)HTML oriented. Generally, I've found calibre's check to be much less useful than epubcheck since quite a few errors that check does not detect are picked up by epubcheck. |
|
09-20-2024, 10:14 PM | #13 |
Bibliophagist
Posts: 40,549
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
You can re-arrange an ePub in Sigil and calibre's ebook-editor though I find Sigil's Arrange to Sigil Norm tool to be easier to use.
|
09-20-2024, 10:22 PM | #14 | |
Well trained by Cats
Posts: 30,447
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
<style> </style> It may not have been your intention to delete the contents and this gives you a warning to undo /abort an edit that went bad. Personally, I like Lean, Neat code |
|
09-21-2024, 08:22 AM | #15 |
Evangelist
Posts: 450
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Updating source while running from source | ownedbycats | Development | 2 | 01-30-2022 06:32 AM |
Import Data sees new empty folders as not empty | mivetters | Library Management | 6 | 12-21-2019 04:18 PM |
[Metadata Source Plugin] Empty Plugin? (Fake Identifier) | mneimeyer | Plugins | 3 | 11-11-2019 09:07 PM |
Well. That's unexpected. | skb | Writers' Corner | 5 | 05-06-2019 11:38 PM |
lots of empty folders, "no suitable source format found" -- clueless | etitameh | Calibre | 11 | 08-08-2010 10:30 PM |