Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: PerlMonks has changed me

by tmoertel (Chaplain)
on Sep 03, 2005 at 06:21 UTC ( [id://488865]=note: print w/replies, xml ) Need Help??


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

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

Replies are listed 'Best First'.
Re: PerlMonks has changed me
by jonadab (Parson) on Sep 03, 2005 at 10:22 UTC
    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.

      It's practically verbatim off the W3C site.
      Please understand that I am not saying the initialism "XHTML" does not expand into the words "Extensible Hypertext Markup Language." Rather, I am pointing out that Extensible HTML "is" HTML no more than a horseless carriage "is" a carriage. The first replaces the second, and even through Horseless Carriage 1 seems a lot like Carriage 4, drivers ought to know whether they are driving an automobile or a horse and act accordingly.

      The reason I keep responding to your posts is because I want people reading this thread to recognize that document types mean something: they define a document's content model and markup rules, and they ought to be understood and respected. That's why I have a problem with your "build good habits" advice:

      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.)

      Your advice suggests that authors can turn off their brains and just write XHTML markup because it is always the "good" thing to do, which isn't true. While "write XHTML always" might work for today's stage of the HTML-to-XHTML transition, it won't work in general.

      Rather, I would encourage readers to cultivate the following habit, which truly is good: Always know what type of content you are creating and always use the content model and markup rules associated with that specific type.

      Cheers,
      Tom

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-16 14:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found