3 Replies - 250 Views - Last Post: 10 November 2019 - 02:41 PM

#1 David Madison   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 09-November 19

Need Help with Two Syntax Errors

Posted 09 November 2019 - 09:06 AM

Hello,

I'm hoping you people can tell me how to correct a couple of html syntax errors (326 occurences) in an ebook file.

312 occurences:
Error: ___witch_of_sulphur_mountain_kindle_filtered.html; Line 2332:
Document type doesn’t permit attribute “name” within element “<a>”

Line 2332:
<p class=MsoNormal style='text-align:center'><a name="Agnes_16"></a><a
href="#Photos"><span style='font-size:16.0pt;color:windowtext;text-decoration:
none'><img class="pixels" width=385 height=538 alt="Agnes,
aged 16, high school graduation photo, 1923" id="Picture 33"
src="___witch_of_sulphur_mountain_kindle_filtered.fld/image001.jpg"></span></a></p>

14 occurences:
Error: File___witch_of_sulphur_mountain_kindle_filtered.html; Line 2336:
Value of attribute ”id” for element <img> must begin with one of {A-Z,a-z} followed by zero or more of {A-Z,a-z,0-9, . . .}.


Line 2336:
<p class=MsoNormal style='text-align:center'><a name="Agnes_16"></a><a
href="#Photos"><span style='font-size:16.0pt;color:windowtext;text-decoration:
none'><img class="pixels" width=385 height=538 alt="Agnes,
aged 16, high school graduation photo, 1923" id="Picture 33"
src="___witch_of_sulphur_mountain_kindle_filtered.fld/image001.jpg"></span></a></p>

Thanks kindly for any assistance you can offer.

David Madison

Is This A Good Question/Topic? 0
  • +

Replies To: Need Help with Two Syntax Errors

#2 LadyCynthia   User is offline

  • D.I.C Head

Reputation: 26
  • View blog
  • Posts: 105
  • Joined: 29-December 16

Re: Need Help with Two Syntax Errors

Posted 09 November 2019 - 09:13 AM

For the anchor tags it is saying that it does not like the name attribute. You probably need to replace it with href or id. For your image tags you have spaces, which are not allowed.
Was This Post Helpful? 0
  • +
  • -

#3 David Madison   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 09-November 19

Re: Need Help with Two Syntax Errors

Posted 09 November 2019 - 10:04 AM

Hello, Lady Cynthia,

Many thanks for your super-fast response. With regard to the first error, "name=", heeding your suggestion I tried substituting "href" for "name", but that didn't work. Then I tried "id" for "name"—and that DID work! So I replaced 312 instances, and got 312 less syntax errors—and all the links still work! Hallelujah!. So that just leaves me with 14 of the second error "id=". On this one I am in the dark. As far as I can tell it follows the same form, including spaces, as my previous book, example below, in which there are no syntax errors, and all the links work.

<p class="Titles" style='margin-bottom:0cm;margin-bottom:.0001pt' ><a id="Title_Page" ></a><a href="#TOC" ><span lang=EN-US ><img class="pixels" alt="Title Page" id="Picture24" src="_____ms_spinsters_save_to_web_utf_8_sept_22_18_files/image001.png" ></span></a></p>

The following example is from my current file that flags it as a syntax error:

<p class=MsoNormal style='text-align:center'><a id="Meher_Mount_1956"></a><a href="#Photos"><span style='color:windowtext;
text-decoration:none'><img class="pixels" alt="Meher Mount, circa 1956" id="Picture 15" src="___witch_of_sulphur_mountain_kindle_filtered.fld/image003.jpg"></span></a></p>

Many thanks for your time and expertise.

David
Was This Post Helpful? 0
  • +
  • -

#4 David Madison   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 09-November 19

Re: Need Help with Two Syntax Errors

Posted 10 November 2019 - 02:41 PM

Resolved: I ran the file through an html validator, and got the following error message for each image:

"Bad value “Picture 40” for attribute “id” on element “img”: An ID must not contain whitespace.
From line 3027, column 57 to line 3029, column 69
Code Extract:
on:none' <img class="pixels" width=250 height=342 alt="Agnes,↩aged 21, Antioch College Yearbook photo, 1928"
id="Picture 40"↩src="___witch_of_sulphur_mountain_kindle_filtered.fld/image002.jpg" ></spa"

from which I could see that I needed an underscore between Picture and the number (ex: Picture_40).That fixed the error. My file is now free of syntax errors.

David
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1