SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2008
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What's this? (problem with validation)

    How do I rewrite this into valid HTML 4.01 transitional?

    <iframe src="http://www.google.com/calendar/embed?src=c8d8g1e53a735f0s6onm3knfu0%40group.calendar.google.com&wkst=1&bgcolor=%23FFFFFF&height=614" style=" border-width:0 " width="640" frameborder="0" height="614"></iframe>

    The W3C validator was very upset, but I haven't a clue as to what it is saying:

    Warning Line 35, Column 109: cannot generate system identifier for general entity "wkst".

    …nm3knfu0%40group.calendar.google.com&wkst=1&bgcolor=%23FFFFFF&height=614" sty



    An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (. The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".

    Entity references start with an ampersand (&) and end with a semicolon (. If you want to use a literal ampersand in your document you must encode it as "&amp;" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and &aelig; are different characters.

    AND

    Warning Line 35, Column 116: cannot generate system identifier for general entity "bgcolor".

    …0%40group.calendar.google.com&wkst=1&bgcolor=%23FFFFFF&height=614" style=" bo



    An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (. The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".


    Thanks!

    Polly

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,269
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)
    Entities are "something that represents something else". i.e.
    &lt; means "display a <"
    &amp; means "display an &"

    The syntax for an entity is "& abc ;"

    So when the validator sees an & it thinks it's the beginning of an entity. eg. it looks to see what &bgcolor represents.

    But the error message told you that in it's own way.

    It also told you how to fix it.
    If you want to use a literal ampersand in your document you must encode it as "&amp;" (even inside URLs!).

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2008
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I thought you meant "replace the two & with &amp".

    So I tried that, and it still doesn't validate.

    Could you please be more specific? I really am very new at this.

    And while we're on this bit, "iframe", while supported, is deprecated, I understand. What would I use in place of it?

    TIA!

    Polly

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,269
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)
    Yes, that's what I meant (with an ending semi-colon). So an invalid URL like
    HTML Code:
    http://www.google.com/calendar/embed?src=c8d8g1e53a735f0s6onm3knfu0&#37;40group.calendar.google.com&wkst=1&bgcolor=%23FFFFFF&height=614
    with 3 & -- wkst, bgcolor and height,
    should pass validation if it's like
    HTML Code:
    http://www.google.com/calendar/embed?src=c8d8g1e53a735f0s6onm3knfu0%40group.calendar.google.com&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;height=614
    According to the w3c an object tag should be used instead of an iframe tag (even though the object tag has some support issues). It could be just me, but last time I tried to replace one (a few years ago) I had trouble getting it styled right and gave up. Maybe you'll have better luck.

  5. #5
    SitePoint Enthusiast
    Join Date
    Sep 2008
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    YES.

    It validates!

    Thank you; that was my last page to validate; on to link checking and accessibility!

    Polly


Bookmarks

Posting Permissions

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