XHTML vs. HTML

On Wednesday, June 25, 2003, at 02:04 PM, Tim Roberts wrote:
> Should we not encourage developers to write well-formed code.

Sure, we should.  But you can write properly valid SGML-based HTML,
too.

> It is similar to saying it is ok to produce written material if some 
> of the print is smudged or a page is upside down. Is it really fair on 
> the people we are producing content for.

Fair?  This isn't an issue of fairness.

Do you believe that if some of the print is smudged, nobody should
be able to view any of the printed material?  For example, if page
241 of the latest Harry Potter is printed upside down, should you
be unable to read ANYTHING in the book?

If you believe that is the correct standard to use, then you should
be using XHTML.

> In accessibility we are working towards getting things as "good as we 
> can for the greatest number of users". And in reality, who has an 
> XHTML browser that will not display an XHTML page correctly.

Who has that?  I don't know.  But if your browser still displays
XHTML which is not well-formed, then you have a _broken_ XHTML
browser.

Consider the following snippet:

      <p>
        This is a great page:
        <a href="http://www.w3.org/">The
          <abbr title="World Wide Web Consortium">W3C's
          Home Page
        </a>
      </p>

Let's say that's on a large page of content.

What should be done here?

In HTML, the browser is able to use the SGML techniques of assuming
that something was left off, and attempt to recover.  The page will
be displayed in some form, even if it's off a little.

In XHTML, the browser is _not_ allowed to do this.  It is a _violation_
of XML (and thus of XHTML) to attempt to display the page.  It is an
XML _fatal error_.

An XHTML browser that does anything except refuse to display the page
above is in violation of the XHTML and XML specifications.

> The reason that badly formed XHTML still displays fine in browsers is 
> for the allowances originally made for bad HTML coding. If we think 
> that poor mark up is fine then lets open the floodgates to a horde of 
> Front Page sites and build sites that don't hold up across browsers. 
> That is not accessibility.

This is not an argument for XHTML vs. HTML.  This is simply an argument
against poorly written HTML.

It's also a non-sensical argument, since no one is arguing for "Front
Page sites."

Please choose one of the following, before we continue with this
discussion:

(1) XHTML pages which forget a closing </abbr> tag should never display,
     or
(2) XHTML pages which forget a closing </abbr> tag should be displayed
     in some way to compensate for the mistake.

If you argue the second, by your logic, you're arguing "for bad HTML"
and thus comes the floodgate.  If you're arguing for the former, why
exactly would you want this?

The fact that there's no position you can take here should be a hint --
there is no inherent superiority to XHTML 1.0 over HTML 4.01, and in
fact there is a great argument to be made for HTML simply because of
the requirement in XML that well-formedness problems are fatal errors.

--Kynn

--
Kynn Bartlett <kynn@idyllmtn.com>                     http://kynn.com
Chief Technologist, Idyll Mountain                http://idyllmtn.com
Author, CSS in 24 Hours                       http://cssin24hours.com
Inland Anti-Empire Blog                      http://blog.kynn.com/iae
Shock & Awe Blog                           http://blog.kynn.com/shock

Received on Wednesday, 25 June 2003 17:25:08 UTC