comparing results of validators

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard

    comparing results of validators

    Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!


    Validator 3 at w3c totally annhialates the page.
    It doesn't like comment tags, nor does it like "alt" not being used with img
    tags.
    While the jigsaw version now says the page is compliant.

    Validator 3 doesn't like the added stuff yahoo puts on for their embedded
    ads, while Jigsaw totally ignores them.

    Validator 3 apparently does not like the use of inline <style> while jigsaw
    does.
    Most interesting.

    So what is the proper use of comment tags within a division?
    <!---- image 101 ---> is not approved of.
    Excuse me. It's a comment. It should be ignored.
    It ignored the // script comments.


  • Steve Pugh

    #2
    Re: comparing results of validators

    On Tue, 14 Dec 2004 10:29:16 -0600, "Richard" <Anonymous@127. 001>
    wrote:
    [color=blue]
    >http://geocities.com/r_bullis/gallery2.html
    >
    >Validator 3 at w3c totally annhialates the page.
    >It doesn't like comment tags, nor does it like "alt" not being used with img
    >tags.
    >While the jigsaw version now says the page is compliant.[/color]

    They're validating different things.
    validator.w3.or g is an HTML validator.
    jigsaw.w3.org/css-validator/ is a CSS 'validator'.
    [color=blue]
    >Validator 3 doesn't like the added stuff yahoo puts on for their embedded
    >ads, while Jigsaw totally ignores them.[/color]

    Because they're HTML errors not CSS errors.
    [color=blue]
    >So what is the proper use of comment tags within a division?
    ><!---- image 101 ---> is not approved of.[/color]

    A comment starts and ends with two dashes. So you have an extra dash
    after the end of the comment but before the close of the declaration.
    That's an error.
    [color=blue]
    >Excuse me. It's a comment. It should be ignored.[/color]

    It is ignoring the comment (everything between -- and --). It's the
    stuff after the comment that's an error.
    [color=blue]
    >It ignored the // script comments.[/color]

    Of course, the content of <script> blocks is CDATA and hence subject
    to different parsing rules.

    Steve

    Comment

    • Arne

      #3
      Re: comparing results of validators

      Once upon a time *Richard* wrote:
      [color=blue]
      > http://geocities.com/r_bullis/gallery2.html
      >
      > Validator 3 at w3c totally annhialates the page.[/color]

      What is "Validator 3"? Do you mean validator.w3.or g?
      [color=blue]
      > It doesn't like comment tags, nor does it like "alt" not being used with img
      > tags.
      > While the jigsaw version now says the page is compliant.[/color]

      The "jigsaw version" ( jigsaw.w3.org ) is a CSS validator only. It
      does'nt validate anything else. The "validator.w3.o rg" validates HTML
      [color=blue]
      > Validator 3 doesn't like the added stuff yahoo puts on for their embedded
      > ads, while Jigsaw totally ignores them.[/color]

      The validator don't like it because it's on top of the file, where the
      doctype spec. should be. Jigsaw don't see any CSS in the "Yahoo stuff",
      since it's javascript only(?)
      [color=blue]
      > Validator 3 apparently does not like the use of inline <style> while jigsaw
      > does.[/color]

      Oh yes, it does. It's something else that cause the error.
      [color=blue]
      > So what is the proper use of comment tags within a division?
      > <!---- image 101 ---> is not approved of.
      > Excuse me. It's a comment. It should be ignored.
      > It ignored the // script comments.[/color]

      The validator want just two hyphens in the comments, like
      <!-- Correct comment -->
      Don't ask me why, it's just like that it is :-)

      --
      /Arne


      The old believe everything, the middle-aged suspect everything and the
      young know everything. (Oscar Wilde)

      Comment

      • Darin McGrew

        #4
        Re: comparing results of validators

        *Richard* wrote:[color=blue][color=green]
        >> <!---- image 101 ---> is not approved of.
        >> Excuse me. It's a comment. It should be ignored.[/color][/color]

        Arne <user@domain.in valid> wrote:[color=blue]
        > The validator want just two hyphens in the comments, like
        > <!-- Correct comment -->
        > Don't ask me why, it's just like that it is :-)[/color]

        As the FAQ <http://www.htmlhelp.co m/faq/html/basics.html#htm l-comments>
        explains:

        A comment declaration starts with "<!", followed by zero or more
        comments, followed by ">". A comment starts and ends with "--", and
        does not contain any occurrence of "--" between the beginning and
        ending pairs.

        So, the first example should be interpretted as:

        <! Start the declaration
        -- Start a comment
        -- End a comment
        image 101 Text not within a comment (not allowed)
        -- Start a comment
        -> Text within a comment

        And neither the second comment nor the declaration itself are closed.

        But browsers don't really support SGML comments. The practical rule for
        HTML comments (from the FAQ) is:

        An HTML comment begins with "<!--", ends with "-->", and does not
        contain "--" or ">" anywhere in the comment. Do not put comments
        inside tags (i.e., between "<" and ">") in HTML markup.
        --
        Darin McGrew, mcgrew@stanford alumni.org, http://www.rahul.net/mcgrew/
        Web Design Group, darin@htmlhelp. com, http://www.HTMLHelp.com/

        "FAILURE IS NOT AN OPTION. It comes bundled with the software."

        Comment

        • Spartanicus

          #5
          Re: comparing results of validators

          Darin McGrew <mcgrew@stanfor dalumni.org> wrote:
          [color=blue]
          >*Richard* wrote:[/color]

          Could you change your quote line to something more standard? Removing
          the asterikses or including the email address allows for more effective
          filtering of follow ups.

          --
          Spartanicus

          Comment

          • Richard

            #6
            Re: comparing results of validators

            The main reason I use <!--- comment ---> is because the editor I use won't
            accept anything less.
            <! comment > is not acceptable.
            <!- comment > is not acceptable.

            I have used the same style before with validated pages.
            So something else may have triggered the errors.


            Comment

            • Michael Winter

              #7
              Re: comparing results of validators

              On Tue, 14 Dec 2004 13:27:44 -0600, Richard <Anonymous@127. 001> wrote:
              [color=blue]
              > The main reason I use <!--- comment ---> is because the editor I use
              > won't accept anything less.[/color]

              If your editor won't accept[1]

              <!-- ... -->

              then it's broken and time to find a new one.

              [snip]

              Mike


              [1] I find it difficult to believe that an editor would somehow prevent
              you from entering valid SGML comment delimiters.

              --
              Michael Winter
              Replace ".invalid" with ".uk" to reply by e-mail.

              Comment

              • Steve Pugh

                #8
                Re: comparing results of validators

                On Tue, 14 Dec 2004 13:27:44 -0600, "Richard" <Anonymous@127. 001>
                wrote:
                [color=blue]
                >The main reason I use <!--- comment ---> is because the editor I use won't
                >accept anything less.[/color]

                IF your editor doesn't except <!-- comment --> then your editor is
                very, very broken and you should drop it.
                [color=blue]
                ><! comment > is not acceptable.
                ><!- comment > is not acceptable.[/color]

                Those aren't comments.
                [color=blue]
                >I have used the same style before with validated pages.
                >So something else may have triggered the errors.[/color]

                You probably used <!-- comment --> before and simply didn't realise
                that this time you'd used --- instead of --.

                Steve

                Comment

                • Harlan Messinger

                  #9
                  Re: comparing results of validators


                  "Richard" <Anonymous@127. 001> wrote in message
                  news:cpnern0lin @news3.newsguy. com...[color=blue]
                  > The main reason I use <!--- comment ---> is because the editor I use won't
                  > accept anything less.
                  > <! comment > is not acceptable.
                  > <!- comment > is not acceptable.[/color]

                  What you've just said is that you're using one wrong format because two
                  other wrong formats don't work. What have you got against using the right
                  format, the one with *two* hyphens on each end?
                  [color=blue]
                  >
                  > I have used the same style before with validated pages. So something else[/color]
                  may have triggered the errors.

                  I don't think so. When I run the following code through the validator:

                  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                  "http://www.w3.org/TR/html4/strict.dtd">
                  <title>Comments </title>
                  <! comment >
                  <!- comment ->
                  <!-- comment -->
                  <!--- comment --->
                  <p>HELLO!</p>

                  I get the following error messages:

                  1. Line 3, column 0: character data is not allowed here

                  <! comment >

                  You have used character data somewhere it is not permitted to appear.
                  Mistakes that can cause this error include putting text directly in the body
                  of the document without wrapping it in a container element (such as a
                  <p>aragraph</p>) or forgetting to quote an attribute value (where characters
                  such as "%" and "/" are common, but cannot appear without surrounding
                  quotes).

                  2. Line 6, column 16: invalid comment declaration: found name character
                  outside comment but inside comment declaration

                  <!--- comment --->

                  3. Line 6, column 0: comment declaration started here

                  <!--- comment --->

                  In error message two, column 16 is the third hyphen in the second trio of
                  hyphens, and that particular hyphen is colored red. So that is indeed being
                  flagged as an error.

                  What I don't understand is why the version with *one* hyphen on each side is
                  accepted.


                  Comment

                  • Jan Roland Eriksson

                    #10
                    Re: comparing results of validators

                    On Tue, 14 Dec 2004 10:29:16 -0600, "Richard" <Anonymous@127. 001> wrote:
                    [color=blue]
                    >http://geocities.com/r_bullis/gallery2.html[/color]

                    [...]
                    [color=blue]
                    >So what is the proper use of comment tags within a division?
                    ><!---- image 101 ---> is not approved of.
                    >Excuse me. It's a comment.[/color]

                    Nope, it's not.

                    It's a Comment Start, directly followed by a Comment End, followed by
                    some misplaced text, followed by yet another Comment Start that has the
                    characters '->' in it and then never ends as a comment until the parser
                    finds yet another sequence of two consecutive 'dashes'.

                    At which place your page is already hopelessly lost for the validator
                    already.

                    You have totally misunderstood the correct syntax of an SGML(HTML)
                    comment.

                    It is built from the following bits and pieces.

                    <! = MDO = Markup Declaration Open
                    -- = COM = Comment Start or End[color=blue]
                    > = MDC = Markup Declaration Close[/color]

                    so the following is a valid comment in SGML(HTML)

                    <!-- this is a comment -->

                    Here is another one that is correct...

                    <!-- this is another comment --
                    -- with two comment lines in it --[color=blue]
                    >[/color]

                    ....now move on to count the balance of 'double dashes' in your page
                    source.

                    Summary:

                    Two consecutive 'dashes' starts a comment, the next occurrence of two
                    consecutive 'dashes' ends that same comment.

                    The very first two 'dashes' _MUST_ follow directly after an initial MDO.

                    After the last two closing 'dashes' there can be arbitrary white space
                    (but absolutely no NAME characters) before the closing MDC.

                    You have some length of road to travel yet, but its nice to see that you
                    have an interest to learn :-)

                    Fix your obvious comment syntax errors first and then come back so we
                    can help you out with the rest of your problems.

                    --
                    Rex


                    Comment

                    • Jan Roland Eriksson

                      #11
                      Re: comparing results of validators

                      On Tue, 14 Dec 2004 16:17:20 -0500, "Harlan Messinger"
                      <h.messinger@co mcast.net> wrote:

                      [...]
                      [color=blue]
                      >What I don't understand is why the version with *one* hyphen on each side is
                      >accepted.[/color]

                      It's not accepted, just an effect of the parser needing to find a place
                      in the data stream where it can "recover" from total "mumbo-jumbo".

                      --
                      Rex


                      Comment

                      • Nick Kew

                        #12
                        Re: comparing results of validators

                        In article <3293j9F3jnju5U 1@individual.ne t>,
                        "Harlan Messinger" <h.messinger@co mcast.net> writes:
                        [color=blue]
                        > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                        > "http://www.w3.org/TR/html4/strict.dtd">
                        > <title>Comments </title>
                        > <! comment >
                        > <!- comment ->
                        > <!-- comment -->
                        > <!--- comment --->
                        > <p>HELLO!</p>
                        >
                        > I get the following error messages:[/color]

                        [chopped]
                        [color=blue]
                        > 1. Line 3, column 0: character data is not allowed here
                        > 2. Line 6, column 16: invalid comment declaration: found name character
                        > outside comment but inside comment declaration
                        > 3. Line 6, column 0: comment declaration started here
                        >
                        > What I don't understand is why the version with *one* hyphen on each side is
                        > accepted.[/color]

                        It isn't. Lines 3 and 4 are character data, which has already been
                        reported as an error in the first message. Put it inside a <div>
                        (so character data *is* allowed) and get another surprise.

                        "Errors" 2 and 3 are a single error - which you have correctly
                        identified - and reporting it as two errors is a longstanding bug.
                        Validate it at Page Valet for a saner report.

                        --
                        Nick Kew

                        Comment

                        Working...