Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts

    Validator throwing up unexplained errors

    I have been checking my webpages for errors and the first thing is that the validator thinks the documents are HTML when they are XHTML
    This is the doctype:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta content="en-gb" http-equiv="Content-Language" /><meta content="text/xhtml; charset=utf-8" http-equiv="Content-Type" />
    Other errors I do not understand is

    EntityRef: expecting ';'

    …"external" title="link to google maps"(this bracket highlighted red)>Google Maps</a> and type in our postcod…



    required attribute "action" not specified

    …lass="heading">Latest News and Events</h2><h3>Calendar</h3><form name="tstest">


    attributes construct error

    … EM BEE Home page">TEN EM BEE Home page</em></a></h1><p class="logtitle">"When…
    (no idea at all with this one)

    <p class="borders2">Otherwise if you are in a related business <script type="text/javascript" src="js-files/mail.js"></script><noscript><p>Sorry, you need Javascript enabled to email us.</p></noscript>

    The validator accepted other <noscript> tags so why will it not accept this one?

    Can anyone help me, going mad.

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,955
    Thanks
    9
    Thanked 726 Times in 720 Posts
    Hard to answer all of these without a link to your page or at least your full code.

    Your doctype looks OK to me - need to see the whole page for this.

    …"external" title="link to google maps"(this bracket highlighted red)>Google Maps</a> and type in our postcod…
    Do you actually have "(this bracket highlighted in red)" in your code? If so that's the problem - looks like you could just delete this.

    Required attribute "action" not specified

    …lass="heading">Latest News and Events</h2><h3>Calendar</h3><form name="tstest">

    It's telling you the problem here - the form tag requires an action - which will be the file to which data in the form is passed for processing.

    Attribute construct error:

    … EM BEE Home page">TEN EM BEE Home page</em></a></h1><p class="logtitle">"When…
    (no idea at all with this one)
    Guessing that that attribute we can only see the end of is an ID, then it's the spaces in the attribute that are causing the problem. Otherwise, need to see your full code...

  • #3
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Yes, more detail is needed on most of these points.

  • #4
    Regular Coder mbaker's Avatar
    Join Date
    Jan 2010
    Location
    Burford, Oxfordshire, United Kingdom
    Posts
    249
    Thanks
    1
    Thanked 39 Times in 39 Posts
    Quote Originally Posted by quartzy View Post
    I have been checking my webpages for errors and the first thing is that the validator thinks the documents are HTML when they are XHTML
    This is the doctype:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta content="en-gb" http-equiv="Content-Language" /><meta content="text/xhtml; charset=utf-8" http-equiv="Content-Type" />
    Which validator are you using?

    When I complete your code snippet with: <title></title></head><body></body></html> the w3c validator reports: This document was successfully checked as XHTML 1.0 Transitional!

    One way to confuse the w3c validator is to select a doctype from the drop down list instead of (detect automatically).

    Quote Originally Posted by quartzy View Post
    EntityRef: expecting ';'

    …"external" title="link to google maps"(this bracket highlighted red)>Google Maps</a> and type in our postcod…
    If your URL contains &, to be valid HTML you need to write &amp;

    For example if your URL contains: ?q=ox18+4ab&ie=UTF8&hl=en&hq=&hnear=Burford,+Oxfordshire you need to write: ?q=ox18+4ab&amp;ie=UTF8&amp;hl=en&amp;hq=&amp;hnear=Burford,+Oxfordshire

    The w3c validator error message for Entity Ref errors contains a link to a page that gives a very full description of what you need to do to fix ampersands in URLs.

    Quote Originally Posted by quartzy View Post
    required attribute "action" not specified

    …lass="heading">Latest News and Events</h2><h3>Calendar</h3><form name="tstest">
    As SB65 pointed out, every form must have an action attribute, even if it is only <form action="">

    Quote Originally Posted by quartzy View Post
    attributes construct error

    … EM BEE Home page">TEN EM BEE Home page</em></a></h1><p class="logtitle">"When…
    (no idea at all with this one)
    This occurs when you don't have a space between two attributes, as in: <em class="myclass"title="TEN EM BEE Home page">TEN EM BEE Home page</em> instead of the valid: <em class="myclass" title="TEN EM BEE Home page">TEN EM BEE Home page</em>

    Quote Originally Posted by quartzy View Post
    <p class="borders2">Otherwise if you are in a related business <script type="text/javascript" src="js-files/mail.js"></script><noscript><p>Sorry, you need Javascript enabled to email us.</p></noscript>

    The validator accepted other <noscript> tags so why will it not accept this one?
    You need to close the <p class="borders2"> before you start the <noscript>.
    Last edited by mbaker; 06-06-2010 at 08:57 PM. Reason: spelling correction
    - Michael Baker - HTML Tags Guide - Reference and Tutorials
    - Like voting, validate early, validate often - W3C HTML Validator - W3C CSS Validator
    - Wot? me cynical? no, its just if you vote, er, validate early, you have more chance of validating often.

  • #5
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts

    Re

    I dont think that the validator was feeling very well, when it first done my scripts apart from the <noscript> I have not changed anything and now one page has passed that did not before.

    I would like to post my code link but it is very very wide and very condensed and not very good, I am having problems previously posted in this forum, also it seems I have a BOM mark but I dont know where from, I am using sharepoint designer 2007, as I like the interface of this, but I do code, but if anyone could look at this page, would be great as the validator thinks that the <div id="wrapper"> is wrong for some reason. www. tenembee.org. uk/useful-links.html

  • #6
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts

    Re

    All of the above are now sorted, it seems that the validator does not like condensed code.

  • #7
    Regular Coder mbaker's Avatar
    Join Date
    Jan 2010
    Location
    Burford, Oxfordshire, United Kingdom
    Posts
    249
    Thanks
    1
    Thanked 39 Times in 39 Posts
    When working on your pages it would probably help to take a copy, and insert a line break after every >. It will make locating problems in the source easier.

    Code:
    Line 6, Column 998: document type does not allow element "noscript" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag
    …="js-files/mail.js"></script><noscript><span>Sorry, you need Javascript enable…
    The context here is:

    Code:
    <p class="borders2">
    Otherwise if you are in a related business <script type="text/javascript" src="js-files/mail.js">
    </script>
    <noscript>
    <span>
    Sorry, you need Javascript enabled to email us.</span>
    </noscript>
     us to see if it would be mutually beneficial to link reciprocally.</p>
    The problem is that while <script> is allowed inside of <p>, <noscript> is not.

    One solution would be to do without the <noscript> as in:

    Code:
    <p class="borders2">
    <span id="email">
    Sorry, you need Javascript enabled to email us.</span>
    </p>
    <script type="text/javascript" >
    var email = getEmail();
    var message = "Otherwise if you are in a related business " + email + " us to see if it would be mutually beneficial to link reciprocally.";
    document.getElementById( "email" ).innerHTML = message;
    </script>
    You would then need to modify js-files/mail.js so that instead of ending: document.write("<a href='mailto:"+link+"'>Email</a>"), it was set up as a function (getEmail()) that ends: return "<a href='mailto:"+link+"'>Email</a>";

    Code:
    Line 6, Column 80: attributes construct error
    …an></a></li><li><a href="policies.html"><span>Policies</span></a></li><li><a h…
    When I look at a version of your page with line breaks (as suggested above) this error is reported as:

    Code:
    Line 176, Column 36: attributes construct error
    <a href="http://www.lewisham.org.uk"rel="external" title="link to lewisham coun…
    The problem is that there is no space between href="http://www.lewisham.org.uk" and rel="external"

    The rest of the errors cascade from this single error.
    - Michael Baker - HTML Tags Guide - Reference and Tutorials
    - Like voting, validate early, validate often - W3C HTML Validator - W3C CSS Validator
    - Wot? me cynical? no, its just if you vote, er, validate early, you have more chance of validating often.

  • #8
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts

    Re

    Many thanks for your help, particularly the noscript thing which I will adopt when I get time. I relise that I should insert a break but I use the sharepoint designer optimiser and it just shrinks everything. Otherwise I would be doing the site forever, also he changes it often. But learning again which is great.

  • #9
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    This is the doctype:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><meta content="en-gb" http-equiv="Content-Language" /><meta content="text/xhtml; charset=utf-8" http-equiv="Content-Type" />
    FYI, only the first tag constitutes your DOCTYPE.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    quartzy (06-07-2010)

  • #10
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Quote Originally Posted by abduraooft View Post
    FYI, only the first tag constitutes your DOCTYPE.
    Also, text/xhtml is not the XHTML MIME type: it is application/xhtml+xml (or application/xml). However, as the browser ignores this, taking the HTTP header, and only scans it for the charset, text/html should be used. Note well that XHTML Transitional should not be used for newly-authored documents.

  • #11
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts

    re

    Hello again
    Can you explain why I could not use XHTML transitional for new documents? The doctype I had to find, as the validator did not like the just bare ones, and the xml kept throwwing the pages out with IE.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •