none
Problems, Problems, Problems RRS feed

  • Question

  • ?Using the Step by Step HTML and XHTML book published in 2006, I am using the practice files that came with it. The doctype is as follows:

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

    The further I delve into this book, the more problems I find:

    <meta name="keywords" content="pests, weeds, fungus, plants, flowers, vegetables" />

    This 'red squiggled' line is one of the first ones that popped up. When I hover over it, I'm told that 'This element is not allowed to be self closing in the current schema. Remove the closing slash.' So, I do that and everything is OK with that line. The next problem line is:

    <hr style="color: green; background-color: green; height: 3" />

    I'm told the same thing, 'This element is not allowed to be self closing in the current schema. Remove the closing slash.' So, I do that too; however, the 3 is now squiggled, which means it needs 'px' added.

    It gets better . . .

    <ul><a href="spray.htm#equipment"><li>Equipment</li></a>

    In this line, <a is 'squiggled' as well as <li>. Hovering over <a I am told: In Internet Explorer 8.0 the tag <ul> cannot contain a tag <a>. Hovering over <li> I am told that In Internet Explorer 8.0 the tag <a> cannot contain a tag <li>.

    So, I start to experiment . . . I change the line to:

    <ul><li><a href="spray.htm#equipment">Equipment</a></li>

    And it works; at least no more squiggles. However, I'm not so sure this is correct, since I was experimenting. It does work, though.

    I am told to remove the ending slash in </br>

    Going into Styles, I am told to type the following code:

    <style>
    hr {

    color: red;
    background-color: red;
    height: 10px;
    width 50%;
    text-align: left;
    }
    </style>

    Now, <style> is squiggled and I'm told:

    All <style> tags must have a type attribute.

    And the list goes on . . .

    When I change the doctype to EW's default, I get a whole 'nother' laundry list of errors!

    I have come to a few conclusions, which are probably totally irrelevant, but at this time, I have nothing left to go on but my slightly illogical logic.

    The book was probably written circa 2005, since it has a 2006 copyright.

    Although I'm told I've made all these 'errors', when I check the code in IE9 beta, Firefox, Chrome, Safari and Opera, everything seems to be OK. IOW, it seems to work correctly.

    In 2006, none of the code written was "aware" of IE 7, much less 8 or 9. I would say the same for the rest of the browsers.

    The author claims to not be using any deprecated code.

    And this is where my logic fails me. Why is EW complaining about almost every bit of code? I really like the way the book is written and presented, but at this point, I'm beginning to wonder about the author. Or, could it be that standards have changed somewhat since 2006?

    I'm stumped.


    Nancy Ward
    Wednesday, February 9, 2011 9:19 PM

All replies

  • EW is complaining because it's supposed to tell you when you, for example, use the wrong syntax for the Doctype (self closing, slashes, or not).  And, yes, <style> tags are supposed to have an attribute (see http://www.w3schools.com/TAGS/tag_style.asp).  Etc.

    Errors doesn't mean a browser won't figure them out.  But you problably want to learn how to do things without errors.

    I might suggest you either take this book and EW's error identification as a way to learn, or use different examples.

    Adding: I would expect that a book with both HTML and XHTML in the title would be telling you which it was using, and you shouldn't run into the issues you have seen with the closing />, or not.

    Wednesday, February 9, 2011 9:45 PM
  • If the book's practice files contain this doctype

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

    then the DTD (Document Type Definition) that EW uses for error checking will be for HTML 4.01. As indicated, self-closure is not appropriate for that DTD. Self-closure is a requirement of XML-based markup languages such as XHTML 1.x, but not for HTML.

    That that same practice file then contains markup extensively employing self-closure indicates that the book is poorly edited, or that the author didn't understand the difference in or the markup implications of the doctypes. In either case, I think that if it were me, I would adopt a different, perhaps more recent book to work with. Just MHO...

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.
    Wednesday, February 9, 2011 10:11 PM
  • Scott,

    In case you didn't know Chris Leeds writes the Step by Step series EW books. So you can tell him directly. <g>


    Expression Web Tutorials & Help http://by-expression.com
    Expression Web forums
    Wednesday, February 9, 2011 10:14 PM
  • Really? I wonder if he knows about this, or if it has been corrected in the book's online errata... ?

    (And, no, I didn't know. ;-)

    Nancy, most computer technology books publish errata pages online. Have you checked to see if this has been updated since the book's publication?

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.
    Wednesday, February 9, 2011 10:49 PM
  • Thanks, Kathy:

    EW is complaining because it's supposed to tell you when you, for example, use the wrong syntax for the Doctype (self closing, slashes, or not). And, yes, <style> tags are supposed to have an attribute (seehttp://www.w3schools.com/TAGS/tag_style.asp).  Etc.

    Yeah, I know EW is just doing its job. It's just disturbing that I should encounter all these errors. Especially when I see this: "In HTML, <br> without the ending slash is acceptable usage, but in XHTML, you must use <br/>." What I 'read' is that <br /> is not a problem in HTML; however, EW says it is. :(

    Errors doesn't mean a browser won't figure them out.  But you problably want to learn how to do things without errors.

    Yup, the browsers have all figured it out. and, yes, I do want to learn how to do things without errors.

    I might suggest you either take this book and EW's error identification as a way to learn, or use different examples.

    I'm learning; however, I'm not too sure that I'll be less confused or more confused when this process is over. If I could find a newer book that is as well written as this one, I would grab it immediately.

    Adding: I would expect that a book with both HTML and XHTML in the title would be telling you which it was using, and you shouldn't run into the issues you have seen with the closing />, or not.

    Each of the practice files has the doctype built in. The author seems to be using HTML 4.01 Transitional in the early chapters. I figure she will get to XHTML Transitional in later chapters.

    Nancy


    Nancy Ward
    Wednesday, February 9, 2011 11:07 PM
  • >>That that same practice file then contains markup extensively employing self-closure indicates that the book is poorly edited, or that the author didn't understand the difference in or the markup implications of the doctypes. In either case, I think that if it were me, I would adopt a different, perhaps more recent book to work with. Just MHO...
    =======

    Ohhhhhhh, Scott, you make me feel sooooooo validated. :) If I can find a newer book, I definitely will do so!

    Nancy


    Nancy Ward
    Wednesday, February 9, 2011 11:09 PM
  • >>In case you didn't know Chris Leeds writes the Step by Step series EW books. So you can tell him directly. <g>
    =======
    I just ordered and received that book, Cheryl, but have not started to peruse it yet because I want to get my feet on the ground with HTML/XHTML first.


    Nancy


    Nancy Ward
    Wednesday, February 9, 2011 11:11 PM
  • >>Nancy, most computer technology books publish errata pages online. Have you checked to see if this has been updated since the book's publication?
    ==========
    Yeah, Scott, I knew about errata pages, but haven't looked yet. That's gonna be some long-winded errata! So much of it I'm not sure I can stand it. :)

    Nancy


    Nancy Ward
    Wednesday, February 9, 2011 11:13 PM
  • >>Nancy, most computer technology books publish errata pages online. Have you checked to see if this has been updated since the book's publication?
    ==========
    OK, I went to Microsoft to look for errata, but was sent to O'Reilly.com (seems they now publish the step by step books). However, since O'Reilly wasn't the original publisher, it wasn't found.

    No errata to be found. Sigh . . .


    Nancy Ward
    Thursday, February 10, 2011 12:58 AM
  • Nancy, with EW the DOCTYPE is not enough to get the editor to assume a particular schema.

    Instead, under Tools | Page Editor Options click the Authoring tab. You will then see a section for Doctype and Secondary Schema and a section for CSS schema. These are application-level settings that tell EW which schema to use as the default. In theory, the DOCTYPE given on a particular page should override this default, but that does not appear to be the case.

    The "red squiggle" errors that you are getting are not errors in the sense that the browser will object. They represent errors that a validator (such as http://validator.w3.org/) will report because the syntax does not strictly obey the rules.


    Will
    Baltimore, MD USA - www.fastie.com
    Thursday, February 10, 2011 2:38 AM
  • >>Nancy, with EW the DOCTYPE is not enough to get the editor to assume a particular schema.
    =======
    Thanks, Will. I did what you said, but that doesn't seem to have done the trick. I changed the secondary to IE6, then to IE7 and finally back to IE8. Nothing in the code window changed. I even shut down EW, reopened it and reopened the practice files. Nuttin' works to change things.

    I left CSS at 2.0, rather than change it, since I'm not there yet.


    Nancy Ward
    Thursday, February 10, 2011 3:38 AM
  • Changing the Authoring settings wouldn't change the errors you saw in Code View.

    On the Authoring tab, Doctype sets what EW puts in for new pages.  The doctype on the page (it doesn't have to match the one you've defined as the default for new pages) drives incompatibility notifications and Intellisense. 

    Secondary Schema is what EW uses for incompatiblity notifications and Intellisense if there is no doctype or if the doctype is invalid.  This doesn't apply in your case, since your pages had doctypes.

    The CSS schema determines what will be available for intellisense for CSS.

    The errors you saw were ones that will show up regardless: mismatches between doctype and tag closings, missing types for script tags, etc.

    Thursday, February 10, 2011 5:02 AM
  • Changing the Authoring settings wouldn't change the errors you saw in Code View.

    Kathy, I was mistaken about that. You are right. I was doing some experiments with this two days ago and I was certain I saw self-closing tags with red squiggles when I changed the default schema. I'll have to go back and review that. I always thought the page-level DOCTYPE controlled and that I had spotted a bug, but apparently not.

    As you say, the CSS schema does affect the errors detected.


    Will
    Baltimore, MD USA - www.fastie.com
    Thursday, February 10, 2011 1:31 PM