![]() |
#1 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
URI issues
Hello,
When I validate an ePub I made using: http://validator.idpf.org/application/validate I get an error saying: Quote:
example link that gives an error: How can I get those links to pass validation and still make them go where they should? On another note, I have a file that is 372KB and Calibre Book check spits out that the file is too large. On which specific eBooks readers there might be a problem with those files? Does this limitation still exist in ePub 3? I don't mind performance issues. |
|
![]() |
![]() |
![]() |
#2 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
If you only care about ipads and epub3 reader programs, then it doesn't matter how big the files are. It will make many other readers either slow down or completely fail to open.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
If the big file has multiple chapters in it, you should split anyway, for organizational and chapter-breaking purposes.
|
![]() |
![]() |
![]() |
#4 |
Software Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 190
Karma: 89000
Join Date: Jan 2014
Location: Germany
Device: PocketBook Touch Lux 3
|
Your URL validated perfectly well in an EPUB2, if placed in an XHTML 1.1 file like this:
Code:
<a href="http://hebrewbooks.org/pdfpager.aspx?req=22413&st=&pgnum=19">Test</a> Code:
<a href="http:">Test</a> |
![]() |
![]() |
![]() |
#5 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
URI test
Thanks for the answers guys!
I have created a sample ePub 3 file which will be validated if it wasn't for the URI error I get, please view the attached file. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Software Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 190
Karma: 89000
Join Date: Jan 2014
Location: Germany
Device: PocketBook Touch Lux 3
|
Well, since you've provided an EPUB3 example in your last post, I'm concluding that you're aiming to construct an EPUB3 file instead of EPUB2 (which wasn't explicitly stated in your initial post). Depending on the version of the EPUB standard, the package and the packaged files have to look differently. Validating your example file with the IDPF EPUB validator results in
Code:
Type: ERROR, File: Text/index.html, Line: 8, Position: 786, Message: value of attribute "href" is invalid; must be a UR Code:
No DOCTYPE found! Checking with default XHTML 1.0 Transitional Document Type. Code:
<!doctype html> Code:
<?xml version='1.0' encoding='utf-8'?> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> Code:
The character encoding was not declared. Proceeding using windows-1252. Code:
Saw <?. Probable cause: Attempt to use an XML processing instruction in HTML. (XML processing instructions are not supported in HTML.) <?xml version='1.0' encoding='utf-8'?> Code:
<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>URI test</title> <meta charset="utf-8"/> [...] </head> [...] </html> Code:
Bad value http://www.hebrewbooks.org/pdfpager.aspx?sits=1&req=36784&st=%u05DE%u05D9%20%u05E9%u05D9%u05E9%20%u05DC%u05D5%20%u05E7%u05E6%u05EA%20%u05E9%u05E8%u05E8%u05D4 for attribute href on element a: Percentage ("%") is not followed by two hexadecimal digits. http://en.wikipedia.org/wiki/Percent-encoding for more details on URL escaping. After that, the URL still won't pass HTML5 validation, because you're still missing the XML entity encoding of the ampersand with &, which was present in your initially posted link. After this last adjustment, index.html is valid HTML5, and therefore shouldn't cause any further problems when packaged to EPUB3. I haven't tried to package the files together and validate the resulting EPUB3, because I guess that there will be HTML5 invalidity in the other files as well, which you need to fix. If you need a packaging tool for EPUB3, just let me know, I could develop a simple one which would be absolutely sufficient for this kind of files. In any case, I don't know how you got to those HTML files, if you've written them by yourself or if you obtained them from an application, but whoever/whatever is responsible for producing this files seems to be not overly concerned about web standards, but indeed should. |
![]() |
![]() |
![]() |
#7 | ||||
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
First of all I have to say i'm impressed and surprised by your extensive reply, it's not taken for granted and I want to thank you for explaining everything in such great detail.
I am familiar with HTML 4.01 and HTML5 standards, however, it never crossed my mind to use the doctype declaration since other ePubs were passing validation via ePubCheck for ePub3. Thanks for pointing out the correct form, I was wondering actually why Calibre automatically inserts a meta tag for charset, I guess next time I need to stop and think before I do ![]() I have used an online URL escape tool via google search, input data was: Output data: Quote:
Quote:
Quote:
Calibre says: Quote:
Last edited by odedta; 04-14-2014 at 05:43 PM. |
||||
![]() |
![]() |
![]() |
#8 |
Software Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 190
Karma: 89000
Join Date: Jan 2014
Location: Germany
Device: PocketBook Touch Lux 3
|
I wouldn't replace :// with %3A%2F%2F, there's no reason to do that, it might even cause trouble in some instances. You only need to URL escape characters which are invalid for URLs, the protocol specification by :// and forward slashes are allowed in general, except in the arguments of HTTP-GET data.
If your href attribute doesn't start with a protocol specification (like http://, file://, ftp:// ...), its value will get interpreted as a reference to a local file, as a path relative to the location of the current document. Code:
Text/http://hebrewbooks.org/pdfpager.aspx Code:
http://hebrewbooks.org/pdfpager.aspx Code:
Text |
![]() |
![]() |
![]() |
#9 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
the Text part is from the relative linking. try pasting in (to the url escape tool) only the part after the "?" in the link.
That should properly escape only the parts that need to be escaped. |
![]() |
![]() |
![]() |
#10 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#11 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
problematic uri, containing a redirection | atlantique | Recipes | 4 | 05-03-2012 01:02 AM |