Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 12-14-2023, 12:10 PM   #1
ESGrant
Junior Member
ESGrant began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2023
Device: Iphone
Unable to publish Epub to Google Play due to html issue

Hello! I am hoping someone can offer me some advice. I am trying to publish my ebook on google play but they are rejecting it due to what seems to be an html issues on two lines in the document. I have checked myself and run an epub checker through amazon and nothing seems to actually be wrong. Does anyone else know about this? I have shared the errors below:

GoogleDoc/TheGoodSamaritan_FINAL_EBook.xhtml:292, 59: Error while parsing file: element "hr" not allowed here; expected the element end-tag, text, element "a", "abbr", "area", "audio", "b", "bdi", "bdo", "br", "button", "canvas", "cite", "code", "data", "datalist", "del", "dfn", "em", "embed", "i", "iframe", "img", "input", "ins", "kbd", "label", "link", "map", "mark", "meta", "meter", "ns1:switch", "ns2:math", "ns3:svg", "object", "output", "picture", "progress", "q", "ruby", "s", "samp", "script", "select", "small", "span", "strong", "sub", "sup", "template", "textarea", "time", "u", "var", "video" or "wbr" (with xmlns:ns1="http://www.idpf.org/2007/ops" xmlns:ns2="http://www.w3.org/1998/Math/MathML" xmlns:ns3="http://www.w3.org/2000/svg") or an element from another namespace

GoogleDoc/TheGoodSamaritan_FINAL_EBook.xhtml:344, 59: Error while parsing file: element "hr" not allowed here; expected the element end-tag, text, element "a", "abbr", "area", "audio", "b", "bdi", "bdo", "br", "button", "canvas", "cite", "code", "data", "datalist", "del", "dfn", "em", "embed", "i", "iframe", "img", "input", "ins", "kbd", "label", "link", "map", "mark", "meta", "meter", "ns1:switch", "ns2:math", "ns3:svg", "object", "output", "picture", "progress", "q", "ruby", "s", "samp", "script", "select", "small", "span", "strong", "sub", "sup", "template", "textarea", "time", "u", "var", "video" or "wbr" (with xmlns:ns1="http://www.idpf.org/2007/ops" xmlns:ns2="http://www.w3.org/1998/Math/MathML" xmlns:ns3="http://www.w3.org/2000/svg") or an element from another namespace
ESGrant is offline   Reply With Quote
Old 12-14-2023, 01:38 PM   #2
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,097
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Welcome to MR!!

It looks like you are putting an <hr/> tag in an incorrect location. It should be all by itself, not embedded inside a <p> or <div> tag.

Code:
Wrong:
<body>

<div>yadda yadda. <hr/></div>

<p>yadda yadda. <hr/></p>

<span>yadda yadda. <hr/></span>

</body>

Correct:
<body>

<div>yadda yadda.</div>

<hr/>

<p>yadda yadda.</p>

<hr/>

</body>
Also, make sure you are properly closing the tag <hr/> not <hr>.

If that doesn’t fix the problem, could you post the section of html that is causing the problem, not just the error code.

Cheers!
Turtle91 is online now   Reply With Quote
Old 12-14-2023, 02:38 PM   #3
nabsltd
Evangelist
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
Posts: 417
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
Quote:
Originally Posted by Turtle91 View Post
It looks like you are putting an <hr/> tag in an incorrect location. It should be all by itself, not embedded inside a <p> or <div> tag.
Although this is likely the issue causing the error message, it's not really an error.

<hr /> can appear where many of the elements listed in the the error can appear, because they are all "flow content":

https://www.w3.org/TR/2011/WD-html5-...l#flow-content

Google Books seems to be expecting "phrasing content", but there is no explicit rule that says that "flow content" elements cannot appear inside of other "flow content" elements. For example, we all know that div and p can contain other flow content, like blockquote and table.

Essentially, there is nothing special about div and p, according to the HTML standard, and there is no rule that only "phrasing content" can appear within "flow content".
nabsltd is offline   Reply With Quote
Old 12-14-2023, 02:47 PM   #4
ESGrant
Junior Member
ESGrant began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2023
Device: Iphone
Thank you both for your responses. I should have mentioned in my original message: I know exactly nothing about html. I have no idea how to access whatever html code is contained within my google doc. Are you able to tell me how to alter the code to resolve this issue?
ESGrant is offline   Reply With Quote
Old 12-14-2023, 02:51 PM   #5
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by nabsltd View Post
Essentially, there is nothing special about div and p, according to the HTML standard, and there is no rule that only "phrasing content" can appear within "flow content".
That may be true for HTML 5, but there is indeed something special about P in HTML 4.01: https://www.w3.org/TR/html401/struct/text.html#h-9.3.1

"The P element represents a paragraph. It cannot contain block-level elements (including P itself)."
Jellby is offline   Reply With Quote
Old 12-14-2023, 03:45 PM   #6
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,097
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by ESGrant View Post
Thank you both for your responses. I should have mentioned in my original message: I know exactly nothing about html. I have no idea how to access whatever html code is contained within my google doc. Are you able to tell me how to alter the code to resolve this issue?
I would recommend getting a basic understanding of html and css. There are some good tutorials here in the MR wiki. You don’t need to learn how to be a "coder" but a basic understanding will make life much easier.

In the meantime I would recommend installing one of the free ePub editors: Sigil or Calibre - they have their own threads here on MR. Then you can open the ePub with that software and see the different parts and pieces. From there you can search for <hr and see where the problem is.

Edit: I would start looking at lines 292 and 344 in the html file titled: TheGoodSamaritan_FINAL_EBook.xhtml

Last edited by Turtle91; 12-14-2023 at 03:55 PM.
Turtle91 is online now   Reply With Quote
Old 12-15-2023, 12:04 PM   #7
nabsltd
Evangelist
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
Posts: 417
Karma: 6913952
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
Quote:
Originally Posted by Jellby View Post
That may be true for HTML 5, but there is indeed something special about P in HTML 4.01:
That doesn't matter, because HTML "versions" no longer exist...it's all version 5 now, even if there are changes and new features.

And, the EPUB spec says that specifically:
Quote:
The benefit of this approach for EPUB is that EPUB publications always keep pace with changes to the web without the need for new revisions. EPUB creators, however, must keep track of the various changes to HTML and the technologies it references to ensure they keep their processes up to date.
https://www.w3.org/TR/epub-33/#sec-o...relations-html
nabsltd is offline   Reply With Quote
Old 12-15-2023, 12:56 PM   #8
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
If you're stuck with EPUB2, you're stuck with XHTML 1.1 too (or with whatever subset the reading application supports).

Anyway, about HTML 5:

Quote:
Originally Posted by nabsltd View Post
Google Books seems to be expecting "phrasing content", but there is no explicit rule that says that "flow content" elements cannot appear inside of other "flow content" elements.
The p element says (https://html.spec.whatwg.org/multipa...he-p-element): "Content model: Phrasing content.", where "Content model" means (https://html.spec.whatwg.org/#concep...ontent-model): "A normative description of what content must be included as children and descendants of the element."

Whereas the div element says (https://html.spec.whatwg.org/multipa...-div-element): "Content model: [...] If the element is not a child of a dl element: flow content."

So it seems to me there's still something special about the p element, it can only contain "phrasing content" and not "flow content", as the div element can.
Jellby is offline   Reply With Quote
Old 12-16-2023, 01:12 AM   #9
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by ESGrant View Post
Thank you both for your responses. I should have mentioned in my original message: I know exactly nothing about html. I have no idea how to access whatever html code is contained within my google doc. Are you able to tell me how to alter the code to resolve this issue?
Shameless plug: install my EPUBCheck plugin for Sigil or Calibre and run it. Then click the error messages and post the HTML code, including the line before and after the line with <hr /> or <hr> in it.

Last edited by Doitsu; 12-16-2023 at 01:21 AM.
Doitsu is offline   Reply With Quote
Old 12-28-2023, 07:06 AM   #10
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
In my experience, Google Play sells so few books that a heroic effort to comply with its rather odd uploading requirements isn't justified by the income a book generates. If it goes smoothly, I don't mind following Google's little rituals, but if it doesn't go smoothly, I forget it and move on.

When Google first began offering e-publication, there was great alarm on the Kindle message board that Google would end Kindle's dominance. Didn't quite work out that way! For me, it ranks down there with Hoopla as a money-maker.
Notjohn is offline   Reply With Quote
Old 12-28-2023, 09:40 AM   #11
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: 74,015
Karma: 129333114
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 nabsltd View Post
That doesn't matter, because HTML "versions" no longer exist...it's all version 5 now, even if there are changes and new features.

And, the EPUB spec says that specifically:

https://www.w3.org/TR/epub-33/#sec-o...relations-html
But that's pure BS. ePub does not keep up. That would mean all the programs for your computer, phones, Readers, etc. would have to be updated to keep up with the latest HTML spec. That doesn't happen. Look at a lot of programs for iOS and Android. They don't even keep up with the ePub 2 spec nevermind something new.

When you create an eBook, the way to do it is to keep it simple. For example, in CSS for ePub 3, you can use rem instead of em. But don't when em works in so many more cases and it's the same thing.

There are times when you will want to use something that won't work in older software (or some software). So in that case, you use fallbacks where possible. The way to do it (IMHO) is to install ADE 2.0.1 and look at your eBook with that and see how it looks. That way you'll know it's good enough for older software. You don't want your book to fail on older software. Look at Standard EBooks. They use the most convoluted code on eBooks where the formatting is very simple. They problem is that their eBooks fail to display properly a lot of the time. And in the case of older ADE such as on Kobo and Sony Readers, they fail completely. There's no need for this.

So keep the code as simple as possible so it works in most cases. Don't use the latest and greatest code just because the program you are using to view may support it. If you find it works best, create an ePub 2 and convert to ePub 3 for the accessibility. But always make any ePub 3 backwards compatible with ePub 2 and make sure the eBook works well enough (even if not perfect) with ePub 2.
JSWolf is offline   Reply With Quote
Reply

Tags
epub, google, html, publishing


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone else unable to log in to the Google Play store? 4691mls Windows Devices 4 06-14-2022 09:05 PM
Google Play Books and Nested Lists - Some Weird Display Issue rsuchwani ePub 80 10-10-2021 03:08 PM
Onyx N96ML - FBreader unable to update on Google Play??? stardest Onyx Boox 9 06-04-2016 02:19 PM
Loading eBooks to Google Play Issue SamL Android Devices 3 02-15-2014 02:48 PM
Test EPUB files using Google Play Morganucopia ePub 9 06-29-2013 08:13 AM


All times are GMT -4. The time now is 05:06 PM.


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