Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 08-19-2017, 06:22 PM   #1
Phaedrus Wolfe
Member
Phaedrus Wolfe began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2017
Device: none
Epubcheck: New Error under upgrade to Validator 4.0.2

Manuscript templates that have worked for years have suddenly stopped working. Smashwords, Stealth, and others who have recently upgraded their epubcheck validation are all rejecting my epub files created in Calibre.

The error occurs immediately before each generation of a "Section Break". No problem with "Page Breaks".

Two general types of errors occur, the first is a "Span" error. Here is the Error Warning Notice:
Code:
Error while parsing file 'element "span" not allowed here; expected the element end-tag or element "address", "blockquote", "del", "div", "dl", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ins", "noscript", "ns:svg", "ol", "p", "pre", "script", "table" or "ul" (with xmlns:ns="http://www.w3.org/2000/svg")
Here is the Code in the epub creating the error:
Code:
<span class="calibre4"><span class="calibre5"><br class="calibre7"/>
</span></span>
Here is the Code in the HTML file generated by MS Word that causes Calibre to build this error in the epubs.
Code:
<u><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:blue'><br style=''>
</span></u>

The second type of error is an 'element "b" not allowed here', and the Warning Error Notice is:
Code:
Error while parsing file 'element "b" not allowed here; expected the element end-tag or element "address", "blockquote", "del", "div", "dl", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ins", "noscript", "ns:svg", "ol", "p", "pre", "script", "table" or "ul" (with xmlns:ns="http://www.w3.org/2000/svg")'.
Here is the Code in the epub file creating the error (Notice its identical to the code in the HTML file generated by MS Word):
Code:
<b><span style='font-size:12.0pt;font-family:"Arial","sans-serif"'><br style=''>
</span></b>
Is there something I can do in MS Word to prevent this error, or is the something Calibre can do to fix it? Deleting the offending code from the epub or html files prevents this error. But the nature of it as it changes from manuscript to manuscript makes writing a batch file an impossible solution. Does anyone have any ideas please?
Phaedrus Wolfe is offline   Reply With Quote
Old 08-19-2017, 07:42 PM   #2
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,167
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
What version of calibre?
PeterT is offline   Reply With Quote
Advert
Old 08-19-2017, 08:02 PM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,976
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
It's most likely the <br/> in the span that's the problem. You need to use prober styles in Word. Don't just highlight some text and click something in the toolbar. Word can make a real mess if you don't use it correctly. That mess then becomes a messy eBook that is not so easy to clean up. You should have clean code in your eBook.

One other thing, there's a plugin for Calibre's eBook editor to allow you to validate using epubcheck 4.0.2. Install that and it will help you not get rejected when online shops validate your eBook.

Last edited by JSWolf; 08-19-2017 at 08:04 PM.
JSWolf is offline   Reply With Quote
Old 08-19-2017, 08:31 PM   #4
Phaedrus Wolfe
Member
Phaedrus Wolfe began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2017
Device: none
Quote:
Originally Posted by PeterT View Post
What version of calibre?
Hello Sir,

Thanks. I've tried versions:
calibre-64bit-3.3.0.msi
calibre-64bit-3.6.0.msi

Its definitely connected with the "Section Break" occurring immediately after. Its also definitely connected to the new updates in epubcheck validation now checking something it never checked before.

Any assistance you could give would be appreciated.

Thanks
Phaedrus
Phaedrus Wolfe is offline   Reply With Quote
Old 08-19-2017, 09:01 PM   #5
Phaedrus Wolfe
Member
Phaedrus Wolfe began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2017
Device: none
Quote:
Originally Posted by JSWolf View Post
It's most likely the <br/> in the span that's the problem. You need to use prober styles in Word. Don't just highlight some text and click something in the toolbar. Word can make a real mess if you don't use it correctly. That mess then becomes a messy eBook that is not so easy to clean up. You should have clean code in your eBook.

One other thing, there's a plugin for Calibre's eBook editor to allow you to validate using epubcheck 4.0.2. Install that and it will help you not get rejected when online shops validate your eBook.
We are quite experienced at using styles. Thanks for the notice regarding the new plugin. However, when used, it does not show any epubcheck errors in Calibre, yet the IDPF Epub validator continues to report the error.

Any more suggestions?

Phaedrus
Phaedrus Wolfe is offline   Reply With Quote
Advert
Old 08-19-2017, 10:21 PM   #6
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,401
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Phaedrus Wolfe View Post
We are quite experienced at using styles. Thanks for the notice regarding the new plugin. However, when used, it does not show any epubcheck errors in Calibre, yet the IDPF Epub validator continues to report the error.

Any more suggestions?

Phaedrus
Interesting that you don't see the error running epubcheck 4.0.2 locally while the remote validation shows the error. I don't use the Calibre editor but the epubcheck plugin for Sigil uses the same Java jar file as the online checker and I would suspect the Calibre version does the same. It's possible the dc:type metadata in the epub is hooped so it is not running the correct profile.

One question that comes to mind is what is wrapped around those spans?

Could you try adding a <p> or <div> at the start and </p> or </div> at the end of the error lines to see what that does for the error message?
DNSB is offline   Reply With Quote
Old 08-19-2017, 10:27 PM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by DNSB View Post
Interesting that you don't see the error running epubcheck 4.0.2 locally while the remote validation shows the error. I don't use the Calibre editor but the epubcheck plugin for Sigil uses the same Java jar file as the online checker and I would suspect the Calibre version does the same. It's possible the dc:type metadata in the epub is hooped so it is not running the correct profile.

One question that comes to mind is what is wrapped around those spans?

Could you try adding a <p> or <div> at the start and </p> or </div> at the end of the error lines to see what that does for the error message?

Spans can not be Naked. They must be inside a block (level)
theducks is offline   Reply With Quote
Old 08-19-2017, 11:54 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Dont convert word html, convert docx files directly. https://manual.calibre-ebook.com/faq...e-is-not-valid
kovidgoyal is offline   Reply With Quote
Old 08-20-2017, 04:49 AM   #9
Phaedrus Wolfe
Member
Phaedrus Wolfe began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2017
Device: none
Quote:
Originally Posted by kovidgoyal View Post
Dont convert word html, convert docx files directly. https://manual.calibre-ebook.com/faq...e-is-not-valid
Thank you very much for this suggestion. We gave it a try, and you are quite correct that this error magically disappears when converting our doc files to docx and then to epub. However, for us this adds a number of other difficulties. If I force auto-generation of a TOC, then the reverse links from each chapter back to the TOC do not work. If I change the reverse links to the top of the document, then we need to recreate these each time new info is added to the top of the manuscript template.

Therefore we have always used the following string in a manually created TOC:
Code:
//*[((name()='h1' or name()='h2' or name()='h3' or name()='h4' or name()='h5' or name()='h6' or name()='h7') and re:test(., '\s*((chapter|book|section|volume|part)\s+)|((A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9|Ą|Ć|Ę|Ł|Ń|Ó|Ś|Ź|Ż|ą|ć|ę|ł|ń|ó|ś|ź|ż)(\s+|$))', 'i')) or @class = 'chapter']
This works great when we convert from HTML to epub, but from DOCX it only detects the first three levels of headers.

Is there a way to get Calibre to detect up to 6 or 7 levels of contents when converting to docx? If we could solve this, we would stop using the html format even though it gives us greater control in managing the output through various custom bat files and powershell scripts we run.

Thanks for your time.
Phaedrus Wolfe is offline   Reply With Quote
Old 08-20-2017, 05:00 AM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Simply create a Table of COntents in the docx file, and calibre will read that instead of trying to build it from headings. See the sameple docx file https://manual.calibre-ebook.com/con...word-documents

for an example of doing this.
kovidgoyal is offline   Reply With Quote
Old 08-20-2017, 06:21 AM   #11
Phaedrus Wolfe
Member
Phaedrus Wolfe began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Aug 2017
Device: none
Quote:
Originally Posted by kovidgoyal View Post
Simply create a Table of COntents in the docx file, and calibre will read that instead of trying to build it from headings. See the sameple docx file https://manual.calibre-ebook.com/con...word-documents

for an example of doing this.
Thank you sir,

You have me convinced to make the change. Fiddling with the settings I was able to achieve the goal. We had been creating our own TOC's but Calibre had not been reading them below the 3rd level until now on any files except html.

That part is now working. One last question if you don't mind my asking. Is there a way to make all heading level hyperlinks show up as black instead of blue, while allowing the internal links to outside web pages to remain blue?

Thanks for your assistance.
Phaedrus
Phaedrus Wolfe is offline   Reply With Quote
Old 08-20-2017, 06:25 AM   #12
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,976
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Phaedrus Wolfe View Post
We are quite experienced at using styles. Thanks for the notice regarding the new plugin. However, when used, it does not show any epubcheck errors in Calibre, yet the IDPF Epub validator continues to report the error.

Any more suggestions?

Phaedrus
Given that you are quite experienced with styles in Word, how did you end up with that sloppy code?

Last edited by JSWolf; 08-20-2017 at 06:32 AM.
JSWolf is offline   Reply With Quote
Old 08-20-2017, 11:12 PM   #13
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,401
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by JSWolf View Post
Given that you are quite experienced with styles in Word, how did you end up with that sloppy code?
Hmmm... very likely answer would be:

Word => HTML (likely filtered) => Calibre => epub.
DNSB is offline   Reply With Quote
Old 08-20-2017, 11:13 PM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Use a style in word for heading hyperlinks that specifies the color as black.
kovidgoyal is offline   Reply With Quote
Old 08-21-2017, 05:50 AM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,976
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by DNSB View Post
Hmmm... very likely answer would be:

Word => HTML (likely filtered) => Calibre => epub.
Can't blame Calibre for this one. The sloppy code was in the HTML. Calibre just did a garbage in, garbage out.
JSWolf is offline   Reply With Quote
Reply

Tags
eliment error, epubcheck error, span error, validator 4.0.2


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Epub validator error message weavinator ePub 6 01-08-2016 01:10 AM
Error epubcheck Buble ePub 43 08-15-2014 01:53 AM
Epub validator error code assistance LGDesign ePub 3 03-09-2013 05:08 PM
ePubCheck error deciphering thiefwriter Calibre 5 09-15-2011 07:37 PM
Error on epubcheck Brazz ePub 5 09-01-2011 03:17 AM


All times are GMT -4. The time now is 01:20 PM.


MobileRead.com is a privately owned, operated and funded community.