Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: PerlMonks has changed me

by tmoertel (Chaplain)
on Aug 31, 2005 at 20:59 UTC ( [id://488223]=note: print w/replies, xml ) Need Help??


in reply to Re: PerlMonks has changed me
in thread PerlMonks has changed me

The closing li tags were optional in HTML, up through middle-to-late 1990s. This is no longer true for any even remotely recent version of HTML. The last several versions of HTML are XML document types, so all tags must be closed.
That is not correct. HTML and XHTML are not the same, and every version of HTML is an application of SGML. HTML thus allows for markup minimization when the corresponding document-type definition (DTD) says so, and all of the HTML DTDs – going back to the original version – define the LI element's end tag to be optional.

As long as Perl Monks is served up in HTML, it will be perfectly acceptable to omit any tags the corresponding DTD says are optional.

The W3C's HTML and XHTML Frequently Answered Questions addresses the underlying issues in detail.

Cheers,
Tom

Replies are listed 'Best First'.
Re: PerlMonks has changed me
by jonadab (Parson) on Sep 02, 2005 at 13:32 UTC
    HTML and XHTML are not the same, and every version of HTML is an application of SGML

    No. XHTML is eXtensible HTML. That's what it stands for, and it was named that because that's what it is. SGML-based versions of HTML are very much legacy stuff at this point; they're not extensible in the way that XML is and should not be used going forward. update: and when the W3C says "HTML" today, they are almost always talking about XHTML. For instance, if you go to the W3C website and click on "HTML Activity Statement", everything there is about XHTML, not HTML4.

    If you find old information that says HTML4 is current and should still be used if XML embedding isn't needed, that dates from the very early XHTML era, before XHTML had fully stabilized, and it is no longer the case. Maintaining old, pre-existing HTML4 is one thing, but for new stuff you will do yourself a big favor in the long run if you write it as XHTML now.

    As long as Perl Monks is served up in HTML

    Ok, I had somehow missed the fact that Perlmonks is still serving out all of its pages as HTML4. Ugh. I imagine the reason for that probably has to do with the amount of work that would be involved with fixing it, given the complicated implementation of the site. Yes, if Perlmonks pages are served out as HTML4, then it's technically okay to omit closing tags as per the HTML4 spec, on Perlmonks.

    As a rule, however, it's a bad habbit of which you should really try to break yourself as soon as possible, for a wide variety of reasons. (I won't here go into all the reasons why XHMTL was and is needed, but the W3C has some information up about that. What they don't say is that XHTML is MUCH easier to maintain than legacy HTML, as well as easier to reliably parse.)


    "In adjectives, with the addition of inflectional endings, a changeable long vowel (Qamets or Tsere) in an open, propretonic syllable will reduce to Vocal Shewa. This type of change occurs when the open, pretonic syllable of the masculine singular adjective becomes propretonic with the addition of inflectional endings."  — Pratico & Van Pelt, BBHG, p68
      HTML and XHTML are not the same, and every version of HTML is an application of SGML
      No. XHTML is eXtensible HTML. That's what it stands for, and it was named that because that's what it is.
      I am sorry, but that is incorrect. XHTML is HTML's successor, not merely the XML version of HTML. The goal of XHTML is to replace HTML with a saner, reformulated model for representing hypertext on the web. Yes, the initial versions of XHTML were designed to be backward compatible with HTML, but that goal is only for transition; XHTML 2, for instance, breaks compatibility with HTML and enters entirely new territory. Got it? HTML is one family of markup languages, whose line ended with HTML 4, and XHTML is another family of markup languages that replaces HTML and whose initial versions are backward compatible with HTML.

      XHTML "is" HTML only the layman's sense that HTML means "the mysterious stuff programmers write to make web pages."

      Yes, if Perlmonks pages are served out as HTML4, then it's technically okay to omit closing tags as per the HTML4 spec, on Perlmonks.
      It is not just "technically okay" but perfectly acceptable. If the document type is HTML 4, you are absolutely, positively allowed to use markup minimization. You don't make a web browser's job easier or earn markup karma by using XML markup in HTML documents. If the browser can handle HTML, it knows SGML parsing rules, and it can handle markup minimization just fine.
      As a rule, however, [using HTML markup] is a bad habbit of which you should really try to break yourself as soon as possible, for a wide variety of reasons.
      You can't just make up your own rules that "HTML is bad" and ignore document types. Please understand that document types mean something. If you're writing HTML 4, you ought to use HTML 4's markup model. You can't just say, "Writing in HTML is a bad habit; use XHTML markup instead" because that advice will be wrong for most of the sites on the web, which still serve up their content as HTML. Use the markup that conforms to the document type.

      Cheers,
      Tom

        XHTML is eXtensible HTML. That's what it stands for, and it was named that because that's what it is.
        I am sorry, but that is incorrect.

        It's practically verbatim off the W3C site.

        XHTML is HTML's successor

        Yes, exactly. More specifically, XHTML is HTML4's successor.

        The goal of XHTML is to replace HTML with a saner, reformulated model for representing hypertext on the web. Yes, the initial versions of XHTML were designed to be backward compatible with HTML, but that goal is only for transition; XHTML 2, for instance, breaks compatibility with HTML and enters entirely new territory. Got it?

        At the time of this writing, XHTML2 is not current yet; it is still at the working draft stage. XHTML 1.1 is the current version of HTML, and most folks are still writing XHTML 1.0. (On the whole, writing XHTML 1.0 is not a big problem, because converting it to XHTML 1.1 or 2.0 or 2.2 or whatever later will be easy. In contrast, converting HTML 4.x to XHTML is painful and difficult.)

        If you're writing HTML 4, you ought to use HTML 4's markup model.

        Yes, but HTML4 allows closing non-empty tags such as li and p (li, specifically, being what we were talking about closing upthread); doing so does conform to the doctype; and doing so builds good habits -- because you will presumably not be writing only HTML4 forever. (Other good habbits you should develop, even when writing HTML4, include putting quotes around all attribute values, putting no spaces between the attribute name, the equal sign, and the value, and using the entity and attribute names in lowercase. These changes, perfectly acceptable in HTML4, form habits that will help you when you write XHTML.)

        Frankly, in almost all cases, you shouldn't still be writing HTML4 now (i.e., should not be using legacy doctypes if you can avoid it), because it makes things hard to maintain, since SGML lacks a concept of wellformedness, among other things. (XML in a very real sense is the successor to SGML in an analogous sense to XHTML being the successor to earlier HTML versions.) As you point out above, it is safer and saner to use modern markup doctypes.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://488223]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2024-04-19 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found