Skip to main content
Participating Frequently
April 28, 2020
Answered

W3C validation defaulting to insanely wrong doctype in spite of declaration

  • April 28, 2020
  • 4 replies
  • 4632 views

I've been using Dreamweaver since it was a pup, but put off joining the cloud until recently.  I am a dinosaur. I generally use 4.0 transitional for the few static sites I'm still maintaining, and am primarily working with XHTML in ebook production.  I'm sure what I don't know would fill one of those books. I have googled my fingers off over this situation to no avail.

My doctype declaration is a copy-paste right from W3C: 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

 

My files validate when I use the W3C browser validation tool.  But when I use the Dreamweaver (v.20.1) W3C validation, I get this error message:

Using the preset for XHTML + SVG 1.1 + MathML 3.0 + RDFa 1.1 based on the root namespace. [none]

And it's all downhill from there.

Obviously I can continue to validate through W3C, but it would be nice to sort this out so I can use program validation.  I've tried so many things I can't even list them--and this is happening to files that used to validate quite nicely in my previous non-cloud version on my beloved Win7.  Like I said, a dinosaur.

    This topic has been closed for replies.
    Correct answer Jon Fritz

    Dreamweaver's default validation tool is pulling results results from http://validator.w3.org/nu.

    The /nu is likely the issue for you, that is the W3C's HTML 5 validation tool. Unless you change your entire doctype declaration to <!doctype html> it's going to tell you the declaration is wrong and throw a mountain of errors at you if the rules for your current doctype are any different from HTML5.

    You might be able to fix it by choosing a different validation parser under  Edit > Preferences > W3C Validator 

    4 replies

    Inspiring
    July 15, 2022

    That is correct if you use HTML5 because of the Validator on http://validator.w3.org/nu. Will only validate HTML5, not the other Doctypes. If you have them validated, use The W3C Markup Validation Service, which will take all Doctypes.

    No matter what doctype you select in DW, it will always validate with HTML5 doc and nothing else.
    My tip is to change the link for the Validator in DW.

    Nancy OShea
    Community Expert
    Community Expert
    July 15, 2022
    quoteMy tip is to change the link for the Validator in DW.

    By @Kajrov

    ==========

    My advice is to migrate to HTML5 doc type.  There is no reason not to use it. Since 2014, HTML5 has been the web standard.  

    • You'll have no problems validating code,
    • You can do more with HTML5 -- especially on forms,
    • It's better suited for use on mobile devices & modern browsers.

     

    Nancy O'Shea— Product User & Community Expert
    Nancy OShea
    Community Expert
    Community Expert
    July 17, 2022

    My goal is to take it over to Html5 and PHP site that I know will work for my site without making it alien for my users.


    2300 static files is insane.  Nobody builds huge static sites anymore.  Switch to WordPress.  

     

    WordPress is a CMS which will simplify site maintenance and collaboration from an online dashboard.  Multilingual sites use WordPress because there is a powerful plugin available for it called WPML https://wpml.org/  WordPress uses a blend of HTML5, CSS, JS, PHP & a MySQL database to store content.  Most web hosts support it. And some even install it for you like this one.

    https://www.dreamhost.com/wordpress/

     

    Nancy O'Shea— Product User & Community Expert
    Jon Fritz
    Community Expert
    Jon FritzCommunity ExpertCorrect answer
    Community Expert
    April 28, 2020

    Dreamweaver's default validation tool is pulling results results from http://validator.w3.org/nu.

    The /nu is likely the issue for you, that is the W3C's HTML 5 validation tool. Unless you change your entire doctype declaration to <!doctype html> it's going to tell you the declaration is wrong and throw a mountain of errors at you if the rules for your current doctype are any different from HTML5.

    You might be able to fix it by choosing a different validation parser under  Edit > Preferences > W3C Validator 

    reandnAuthor
    Participating Frequently
    April 28, 2020

    Thank you!  That's a reason I never considered, since I can validate directly through W3C online.  (That issue sure doesn't come up in desperate searches.)

    I had tried changing the preferences without success, unfortunately.  Probably because XHTML isn't a choice in the menu.

    So, this is likely an ignorant question but I'm pretty literal.  You mentioned changing my doctype declaration to indicate an HTML5 document.  Obviously I know crap-all about HTML5.  Is it inclusive of XHTML rules, so my clean XHTML1.1 documents wouldn't just throw a whole new set of errors?  Because if so I can happily build the files as HTML5 and change the doctype before conversion to epub.  My quick research indicates yes--or that perhaps I can simply switch to HTML5 as my base document--but if someone knows that offhand, it would be reassuring, and I can confidently invest the time in learning more.

    (I know it's weird, but working HTML in Dreamweaver is really the cleanest way to build the underlying file for the epub--unless you count Homesite, which is even better for tidying, but which I may have lost in the switch to Win10.  Going directly from the manuscript file through the various programs meant to build epub is just...nasty.  Not that everyone doesn't do it, but they all used to happily use Frontpage, too.)

    Jon Fritz
    Community Expert
    Community Expert
    April 28, 2020

    You can test it out on a new clean page, Hans posted the page minimum above.

    HTML 5 actually removed a lot of superfluous junk from the spec, you no longer need to tell the browser that your <script> tag is type"text/javascript" for example. Most of the errors you'd end up seeing would be "obsolete, use css instead". The structure really hasn't changed all that much, aside from adding semantic tags like <header> instead of using <div id="header">, but they don't need to be used either. You can check out the basics, and fiddle with things you're not familiar with by using the "Try it Yourself" links here: https://www.w3schools.com/html/html5_intro.asp

    There are other changes, but most will be "you don't need that anymore" type messages from the validator.

    hans-g.
    Legend
    April 28, 2020

    Hello,

     

    only to show you how my different (German) DWs start with new php-file, I'll send you the entries:

     

    DW CC 2015:

     

    DW CC 2018:

     

    DW CC 2019:

     

    DW CC 2020:

     

    <!doctype html>

    <html>

    <head>

    <meta charset="utf-8">

    <title>Unbenanntes Dokument</title>

    </head>

     

    <body>

    </body>

    </html>

    <!doctype html>

    <html>

    <head>

    <meta charset="utf-8">

    <title>Unbenanntes Dokument</title>

    </head>

     

    <body>

    </body>

    </html>

    <!doctype html>

    <html>

    <head>

    <meta charset="utf-8">

    <title>Unbenanntes Dokument</title>

    </head>

     

    <body>

    </body>

    </html>

    <!doctype html>

    <html>

    <head>

    <meta charset="utf-8">

    <title>Unbenanntes Dokument</title>

    </head>

     

    <body>

    </body>

    </html>

     

    In my eyes it's always the same and I can say, it sems to have gotten me this far. ;-)))

     

    Hans-Günter

     

     

    pziecina
    Legend
    April 28, 2020

    Don't blame Dw for this.

     

    A few years ago, the W3C anounced that any new (or updated) sites should use (or convert to) the html5 doc type. At the same time they anounced that the old html4/xhtml doctypes are to be considered obsolete, (the debate on that is still ongoing). So as Dw is a tool for web development, (not ebooks) they dropped the older validation routines.

     

    Inspiring
    July 15, 2022

    I can't find that statement from W3C, and they say to use correct  <Doctype> for HTML 4 in my case; as I use frames, it will be 

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
            "http://www.w3.org/TR/html4/loose.dtd"> and/or
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
            "http://www.w3.org/TR/html4/frameset.dtd">

    so I can't use the Validation in Dreamweaver version 21.3 because of the  Doctype bug for html4tr 

     

     

     

    Inspiring
    July 15, 2022