in reply to CGI IMG tag error

That's not an error, that's part of the XHTML standard.
Whenever a tag doesn't have an explicit closing tag, like  <a href="blah"> something</a>, XHTML dictates that it should have a / at the end of the tag. Since IMG stands alone, it receives the slash.
You should also see this with things like the br tag and the p tag. for more info, go check out http://www.w3c.org or read o'reilly's "HTML and XHTML : the definitive guide".

update - 1 (one) kudo for briac

. update - 1 more kudo for ouefmayo.

Replies are listed 'Best First'.
Re: CGI IMG tag error
by briac (Sexton) on Jun 08, 2001 at 19:33 UTC

    The nitpick instant™

    boo, you should know that XHTML dictates lowercased tags and attributes, and attributes values needs to be quoted!

    your example above should look like:

    <a href="blah">something</a>

    - briac!

Re: (boo)Re: CGI IMG tag error
by Melly (Chaplain) on Jun 08, 2001 at 19:19 UTC

    Note to self - learn basics of xhtml. I've even started reading an OR book about xhtml, but just didn't twig. Doh!

    BTW boo_radly shouldn't you always explicitly close the P tag? ;)

    Thanks Monkees

    Tom Melly, tom@tomandlu.co.uk

      In HTML, closing P tags is often unnecessary (since, let's face it, as things stand HTML is about presentation as well as content). A subsequent opening P tag implies that the previous paragraph has ended. In a fairly smallish SGML application with a fixed set of tags with more-or-less well defined meanings such as HTML, you can get away with such things. But in XML, where golly knows ( and golly != the XML parser ) what each tag is supposed to mean, you can't take such liberties. So even though XHTML is a descendant of HTML, since it is an application of XML, it's ipso facto gotta conform to the XML standard.

      Weasel words courtesy [ favourite local politician ]

      perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'
        A few rants:
        1) HTML is structural, which can infer presentation, but it is not presentational itself (that's what CSS is for)
        2) Being really picky here, but <p> marks the start of the paragraph, and always has done.

        Right, to go back to the original question; In xml (and therefore in xhtml), you cannot has empty elements, so <img> is invalid. <img></img> is not (although completely pointless). As a shorthand elements that contain no data can be abbreviated to <img /> which is what is being spewed out by CGI.pm in this instance.

        --
        RatArsed