Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - XHTML vs HTML

 
Thread Tools Search this Thread
Old 07-18-2006, 06:11 PM   #1
Default XHTML vs HTML


Okay, I'm a little fuzzy on the differences between XHTML and HTML spec 4
and above. Anyone have a good url / tute they can recommend?

Anyone have thoughts / opinions on the merits / differences / future of. . .
between them?

M




Michael Laplante
  Reply With Quote
Old 07-18-2006, 06:15 PM   #2
Travis Newbury
 
Posts: n/a
Default Re: XHTML vs HTML

Michael Laplante wrote:
> Okay, I'm a little fuzzy on the differences between XHTML and HTML spec 4
> and above. Anyone have a good url / tute they can recommend?
> Anyone have thoughts / opinions on the merits / differences / future of. . .
> between them?


Just because something is new does not make it better.

  Reply With Quote
Old 07-18-2006, 06:25 PM   #3
Benjamin Niemann
 
Posts: n/a
Default Re: XHTML vs HTML

Michael Laplante wrote:

> Okay, I'm a little fuzzy on the differences between XHTML and HTML spec 4
> and above. Anyone have a good url / tute they can recommend?
>
> Anyone have thoughts / opinions on the merits / differences / future of. .
> . between them?


This has been discussed to death in this and other groups. Just google for
the subject.
Note that this discussion is highly controversial, usually triggering
endless threads when raised (let's see what happens this time), and there
is no generally accepted answer, which one is better.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
  Reply With Quote
Old 07-18-2006, 06:42 PM   #4
Nikita the Spider
 
Posts: n/a
Default Re: XHTML vs HTML

In article <xD8vg.114396$A8.84158@clgrps12>,
"Michael Laplante" <> wrote:

> Okay, I'm a little fuzzy on the differences between XHTML and HTML spec 4
> and above. Anyone have a good url / tute they can recommend?
>
> Anyone have thoughts / opinions on the merits / differences / future of. . .
> between them?


DOn't be surprised if you're fuzzy, the differences are not as obvious
as you might think.

As Mr. Niemann said, this subject has been discussed at great length
here and elsewhere. Google "XHTML versus HTML" and you'll have your
choice of religious wars to read up on. =)

--
Philip
http://NikitaTheSpider.com/
Whole-site HTML validation, link checking and more
  Reply With Quote
Old 07-18-2006, 07:50 PM   #5
Toby Inkster
 
Posts: n/a
Default Re: XHTML vs HTML

Michael Laplante wrote:

> Okay, I'm a little fuzzy on the differences between XHTML and HTML spec 4
> and above.


The only real difference is that XHTML has to obey XML rules, whereas HTML
doesn't. The places it manifests itself are:

1. All elements must be explicitly closed. In HTML some elements have an
optional closing tag (e.g. <p>, <li>) and some elements must never have a
closing tag (e.g. <meta>, <hr>). In XHTML, the closing tags are required.
Optionally, you can compact the opening and closing tags into one tag
(e.g. "<br></br>" crunches down to "<br/>") -- this may improve browser
support.

2. Element and attribute names are case-sensitive. That is, <p> and <P>
are completely different tags -- XHTML uses lower-case for all element and
attribute names, but attribute values still follow HTML rules, as they're
completely consistent with XML syntax.

3. Under HTML there are certain circumstances where attribute values don't
need quoting. Under XHTML, they always need quoting.

There are other minor differences, the full list is here:
http://www.w3.org/TR/xhtml1/#diffs

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

  Reply With Quote
Old 07-18-2006, 07:55 PM   #6
Michael Laplante
 
Posts: n/a
Default Re: XHTML vs HTML

"Michael Laplante" <> wrote in message
newsD8vg.114396$A8.84158@clgrps12...
> Okay, I'm a little fuzzy on the differences between XHTML and HTML spec 4
> and above. Anyone have a good url / tute they can recommend?
>
> Anyone have thoughts / opinions on the merits / differences / future of. .
> . between them?


Oops, didn't realize the controversy surrounding the issue. Disregard this
post -- not interested in starting a debate / flame war / accusations of
trolling, etc

Thx all. . .

M


  Reply With Quote
Old 07-18-2006, 08:39 PM   #7
Michael Laplante
 
Posts: n/a
Default Re: XHTML vs HTML

"Toby Inkster" <> wrote in message
news:b5nvo3-...
> Michael Laplante wrote:


> The only real difference is that XHTML has to obey XML rules, whereas HTML
> doesn't. The places it manifests itself are: [etc]


Okay, that seemed easy enough. Why does the issue seem to generate this huge
amount of controversy? I'm using an xhtml template for a project and am now
wondering if there are some major issues I should be aware of.

M


  Reply With Quote
Old 07-18-2006, 09:58 PM   #8
Benjamin Niemann
 
Posts: n/a
Default Re: XHTML vs HTML

Michael Laplante wrote:

> "Toby Inkster" <> wrote in message
> news:b5nvo3-...
>> Michael Laplante wrote:

>
>> The only real difference is that XHTML has to obey XML rules, whereas
>> HTML doesn't. The places it manifests itself are: [etc]

>
> Okay, that seemed easy enough. Why does the issue seem to generate this
> huge amount of controversy?


Many people like debating which one is better. This is just another
incarnation of flamewars like "Windows vs. Linux", "Perl vs. XY", "Amiga
vs. Atari" and so on.

A specificly controversial topic is Appendix C of the XHTML1.0 specification
(serving XHTML1.0 as text/html), which exploits a bug in (almost) all
existing user-agent implementations (the '/>' in empty elements, which
according to SGML rules, which should be applied to text/html documents,
has a different meaning, but is treated as '>' by tag-soup parsers).

> I'm using an xhtml template for a project and
> am now wondering if there are some major issues I should be aware of.


XHTML has the advantage that you can use lots of generic XML tools to do
your processing on the server-side, e.g. XSLT.
If you are sending the rendered document to the user-agent, you have either
to transform it to HTML or to Appendix C compliant XHTML (or send a 'Please
upgrade your browser' to all IE users).
A generic XML renderer that does not know the special rules of XHTML will
either render all empty elements as "<foobar/>" or "<foobar></foobar>"
(which are equivalent according to XML rules). But empty elements like IMG,
META, BR, .. need the first form (with an additional space before
the '/>'), whereas SCRIPTs pointing to external script files needs the
seconds form.

I'm using lots of XML (XHTML being just a part of it) on the server-side. As
the final step in the processor-pipe there is a 'XHTML to HTML' module. As
explained above you need such a module anyway and a 'XHTML to HTML'
transformation is not really more difficult than a 'XHTML/xml to
XHTML/app.c.' transformation. And for the record: I'm on the 'stick with
HTML4' side

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
  Reply With Quote
Old 07-18-2006, 11:02 PM   #9
Nikita the Spider
 
Posts: n/a
Default Re: XHTML vs HTML

In article <SNavg.111483$I61.7882@clgrps13>,
"Michael Laplante" <> wrote:

> "Toby Inkster" <> wrote in message
> news:b5nvo3-...
> > Michael Laplante wrote:

>
> > The only real difference is that XHTML has to obey XML rules, whereas HTML
> > doesn't. The places it manifests itself are: [etc]

>
> Okay, that seemed easy enough. Why does the issue seem to generate this huge
> amount of controversy? I'm using an xhtml template for a project and am now
> wondering if there are some major issues I should be aware of.


Inkster's right, there aren't huge differences between HTML and XHTML.
In fact, XHTML 1.0's deliberate goal was just a reformulation of HTML
4.01 as XML. However, in the real world one still has to deliver that
XHTML to the client, and therein lies the rub. Documents delivered via
HTTP come with a content type, and that content-type can say that the
document in question is either HTML or XHTML (or a few other things, but
we'll ignore them for the purposes of this discussion).

OK, so far, so good. The problem is that the 10,000 pound gorilla that
is IE6 barfs when it sees an XHTML content type. So as long as IE6 is a
significant player on the browser scene (which will probably be until
about, oh, 2012), Web developers who want to deliver XHTML via HTTP have
three choices:
1) Ignore IE users
2) Use content-negotiation to deliver HTML to IE and XHTML to everything
else.
3) Deliver XHTML as HTML, which amounts to lying about the content type.

#1 is popularity suicide and #2 is more work than most of us are willing
to do, so most opt for #3. Ian Hickson wrote an oft-cited article
discouraging this practice. It is entitled "Sending XHTML as text/html
Considered Harmful":
http://hixie.ch/advocacy/xhtml

Furthermore, Steven Pemberton, chair of the W3C HTML Working Group said
in 2000, "Therefore, documents served as text/html should be treated as
HTML and not as XHTML. There should be no sniffing of text/html
documents to see if they are really XHTML."
http://lists.w3.org/Archives/Public/...0Sep/0024.html

In other words, the practice might be common, but there's some
well-informed folks that are against it. The discussion as to whether or
not this is really OK is another religious debate that usually riles
people up into a good froth.

Personally, I prefer XHTML for all of its crunchy XML goodness, but I
also prefer to send my code with the correct content type, so all of my
code is HTML 4.01 Strict. Now if you'll excuse me, there some folks at
the door. Hmmmm, I wonder why they've got tar and feathers...?

--
Philip
http://NikitaTheSpider.com/
Whole-site HTML validation, link checking and more
  Reply With Quote
Old 07-18-2006, 11:24 PM   #10
Toby Inkster
 
Posts: n/a
Default Re: XHTML vs HTML

Michael Laplante wrote:

> Okay, that seemed easy enough. Why does the issue seem to generate this huge
> amount of controversy?


Not because of any problem with XHTML itself, but rather because of things
that surround it:-

* the world's most used browser supports XHTML only partially,
and mainly co-incidentally (i.e. because it's close enough to
HTML);

* a lot of XHTML authors don't really know what they're doing
and just treat it like it's "HTML 5";

* the whole "text/html" versus "application/xhtml+xml" issue;

and so on.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump