|
|
#1 | ||
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 23
Karma: 13884
Join Date: Jan 2014
Device: apple ipad (3rd generation)
|
Error Parsing attribute name
I can't open an ebook because every section brings up a warning:
"This page contains the following errors: error on line 11 at column 312: error parsing attribute name" The above-mentioned "line 11" is a doozy. I'll post an excerpt first so we can see "Column 312". "312" is apparently where the semicolon is at the end of this excerpt: Quote:
The entirety of "Line 11" is as follows: PHP Code:
Quote:
Thank you. |
||
|
|
|
|
|
#2 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,093
Karma: 6404930
Join Date: Nov 2009
Device: many
|
You need to use CDATA tags to handle the '<' and '>' symbols all throughout your script. They are not allowed in a script tag embedded in an xhtml tag. Alternatively, extract that script into its own javascript .js file, add it to the ebook and use a link tag to pull it in.
For example, the "<t.length;" is being treated like it is the start of a tag and the ; as an attribute. Where on earth did you get this pile of crap from? It looks like a bad html website pulled into a book. The rules of parsing xhtml are much stricter than those used in html where that crap may fly. So either wrap your javascript entirely in a CDATA tag or move it out into its own .js file. Last edited by KevinH; 12-09-2020 at 08:03 PM. |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,093
Karma: 6404930
Join Date: Nov 2009
Device: many
|
Also you will need to make sure this is a epub3 as epub2 does not support javascript at all. If it were me I would delete the entire script tag as it refers to browser engines and not ebook reader engines and is basically crap that no one wants in a epub.
It in fact looks like page load timing analytics crap. And refers to license keys. It even reaches out to a website: bam.nr-data.net See: https://discuss.newrelic.com/t/relic...nitoring/42055 So it is analytics crap which does not belong in a an epub at all. Rip it out is my best advice. Last edited by KevinH; 12-09-2020 at 08:19 PM. |
|
|
|
|
|
#4 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 23
Karma: 13884
Join Date: Jan 2014
Device: apple ipad (3rd generation)
|
Thanks!
You're right. It was an old out of print book I found online on boats. Have no idea what they were trying to do there. Every page has a couple of these lines. When I delete them the page returns to normal like in a fairy tale. Is there a way to delete an entire line using the find and replace feature? I know how to do that for single words or commands. I want to set it to search and delete any line with "script" in it. |
|
|
|
|
|
#5 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,093
Karma: 6404930
Join Date: Nov 2009
Device: many
|
You can use Regular Expression Find and Replace if you understand regular expression syntax to do just that or there may be a plugin like Tag Mechanic that can delete tags.
|
|
|
|
| Advert | |
|
|
|
|
#6 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,093
Karma: 6404930
Join Date: Nov 2009
Device: many
|
I Find and replace enable regular expressions.
If there is only one script tag in each file, using something along the lines of: Find: <script>.*</script> And leave Replace empty Should do it, but save a copy of the epub first in case something goes wrong. If there is more than one script tag per file, you may have to limit the greediness of the match to prevent anything inbetween the two script tags from being deleted. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Parsing error | Notbelonging | Kobo Developer's Corner | 4 | 06-06-2020 04:34 PM |
| epub Error while parsing file: value of attribute "src" is invalid; must be a URI | Bowcat | ePub | 2 | 10-08-2019 11:46 AM |
| Error while parsing file "attribute"_span" | ksrives | Calibre | 2 | 12-13-2018 09:01 PM |
| Error while TOC parsing. | CrossReach | ePub | 3 | 12-23-2017 06:46 AM |
| Error parsing attribute name? | seagull | Calibre | 1 | 01-01-2010 12:30 PM |