RE: HTML or XHTML - why do you use it?

On Wed, 8 Jan 2003, Peter Foti (PeterF) wrote:
> > 
> > So when a document containing the above has its MIME type changed from
> > text/html to application/xhtml+xml, it'll break.
> 
> Once again, this revolves around users switching from text/html to
> application/xhtml+xml.

Yes, my entire argument revolves around this.


> Yes, you are correct, this will cause problems.  Of course, if those
> pages are truly meant to be viewed as HTML then changing the mime type
> would technically be the wrong thing to do. :)

XHTML is XHTML -- if it is correct, then it should work the same whether
it has an XML MIME type or an HTML one.

XHTML that only works when treated as HTML is not XHTML, it's Tag Soup. A
rather sophistcated form of Tag Soup, I'll grant you, but still Tag Soup.


> > I think everyone should use XHTML. But ONLY if they use the
> > application/xhtml+xml MIME type.
> 
> And if the page served as application/xhtml+xml contains HTML elements,

I presume you mean XHTML elements.


> should the browser treat it as tag soup?

No, that would violate the XML specification at a rather fundamental
level.


> For example, if I send an XHTML document that contains elements like
> <h1>,<p>,<strong>, etc., do I need to define CSS styles for each of
> those objects, or will agents use their default HTML styles?

Any XHTML-aware UA will support those elements as XHTML elements and
therefore have a default XHTML UA stylesheet.

Try it with Mozilla or Opera 7, for example.


> > > > Why not just use HTML?
> > > 
> > > Because I want the benefits of using XML tools and validators.
> > > Not to mention the experience of writing valid XML.
> > 
> > What about the benefits of SGML tools and validators, not to
> > mention the experience of writing valid SGML?
> 
> Well, considering that XML is the hot new technology, I see more
> benefit of using XML than some other SGML language (my opinion).

This opinion is the single biggest problem facing the XML world today.
It is the bandwagon I referred to earlier.

The XML used in XHTML is a subset of SGML. In fact, it is a limiting
subset, for example there is no way in XML to say that links may not
be nested, something which _is_ possible in SGML.


> > I agree, on the long run, XHTML-as-XML is better. On the short run,
> > though, we're simply not there. (Largely because of the IEs.)
> 
> I agree.

So don't use XHTML. :-)


> > No such thing as sloppy SGML code. It's either valid or it isn't.
> 
> By sloppy, I mean that this:
> 
> <sgmlcode><foo>Hello <bar>World</bar></foo></sgmlcode>
> 
> is easier to work with and read than something like this:
> 
> <sgmlcode><foo>Hello <bar>bar

This is only valid if the DTD says it is valid, which in the case of
HTML is limited to a few very commonly used elements like <p> and
<li>.

> <sgmlcode><foo>Hello <bar>bar</foo></bar></sgmlcode>

This is invalid SGML.


> <sgmlcode /<foo /Hello <bar /World///
> 
> (Did I get that last one right?  :-)  

Yes.


> The strictness or XML provides a better structure to the documents
> *as far as readability is concerned*.

Nothing is stopping authors from writing readable code.


> > > I guess my argument is that developers should be trained to use
> > > XHTML *correctly*, and your argument seems to be that not enough
> > > people use XHTML correctly so therefore those people should not
> > > use it at all.
> > 
> > Who are you proposing do this training?
> 
> The same people who are currently teaching HTML (the Educational
> system). Currently, a lot of schools will teach HTML instead of
> XHTML. They should update their focus.

The HTML Education System teaches Tag Soup, they don't teach valid
HTML. There's not a chance in hell that they'll start teaching well
formed -- let alone valid! -- XHTML before IE requires it.


> Ok, then how about this:
> <p> My lousy paragraph <br> stinks!
> 
> Should that be interpretted as:
> <p> My lousy paragraph </p><br> stinks!
> 
> or as:
> <p> My lousy paragraph <br> stinks!</p>

The last one.


> Where in the spec is this ambiguity made clear?

The DTD. BR elements are allowed inside P elements.


> > > > Basically, my argument is that if you know what you're doing,
> > > > then sure, go ahead, but that most people don't, and that for
> > > > them it would be a lot easier if they used HTML 4.01 now and
> > > > thus were never tempted to convert these documents to an XML
> > > > MIME type.
> > > 
> > > You don't think it would be better for those people to simply
> > > learn XHTML?
> > 
> > Get real, who is going to teach them?
> 
> The same people who teach them the wrong way to do things. The
> Education system (schools, colleges, etc.).

I never learned HTML at my school or college. In fact the only person
who taught HTML during the entire time I was at my school was me, and
I only had three students, none of which were particularly receptive
to my pleas for valid markup. (The only page left of the entire
school's site is completely invalid and written in Front Page.)


I also agree with everything Boris Zbarbsky wrote.

-- 
Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'

Received on Thursday, 9 January 2003 09:26:18 UTC