The XHTML Factor

F

Frank Thomas

So, where are we (as an industry) with regards to XHTML? I've been going
through a book published in 2002 that promotes the idea that we should all
be looking to create new projects as compliant with XHTML (at least using
the transitional DTD). Is the XHTML standard something developers at large
are taking seriously? Has Microsoft taken it seriously and included XHTML
compliance features into VS.NET 2003 (will they for the next version)? Are
any of you who work on large mission-critical Web applications making your
pages XHTML compliant? Are there any good reasons to avoid XHTML and instead
stay with HTML 4.01 for new projects, or should we automatically make new
pages XHTML compliant?

Thoughts? Rationalle?

Thanks!
 
N

news.microsoft.com

Ken do you know if a webcontrols Id still is changed (_ctl_) in .Net 2.0,
thus making it impossible to use Id with CSS.

To Frank:
As your book describes the best way to go is transitional XHTML.

Thanks,
Anders
 
M

Martin Honnen

Frank said:
So, where are we (as an industry) with regards to XHTML? I've been going
through a book published in 2002 that promotes the idea that we should all
be looking to create new projects as compliant with XHTML (at least using
the transitional DTD).

Well, XHTML 1.0 has nothing more to offer than HTML 4.01 has, it has
exactly the same elements and attributes with the same semantics as in
HTML 4.01 so you do not gain anything in terms of richer document
structure or richer form controls or better separation of content and
presentation.
And indeed the browser with the most market share, MS Internet Explorer,
doesn't really understand XHTML as XML, instead to have that (and other
browsers like Netscape 4) render your XHTML with the HTML 4.01 semantics
you have to write it according to the HTML backwards compatibility
guides given in
http://www.w3.org/TR/xhtml1/#guidelines
and then serve it as text/html to the browser which in the end means the
browser has to use its HTML tag soup error correcting parser to parse
your XHTML.
If you want to see how XHTML really works you need to send it as
application/xhtml+xml to a browser that understands that, like Opera 7
or Netscape 7 or Mozilla. These browsers use an XML parser to parse
content served as application/xhtml+xml, look for elements in the XHTML
namespace http://www.w3.org/1999/xhtml and render them according to the
defined semantics. But as parsing is done with an XML parser it means
the browser will not render anything but an error message to the browser
user if the source document is not well-formed thus if you look at the
following example
http://home.arcor.de/martin.honnen/javascript/200407/test2004071801.html
which is a HTML 4.01 document served as text/html containing two
iframes, one containing a HTML 4.01 document served as text/html with a
deliberate nesting error, and the other iframe containing exactly the
same document but written as XHTML 1.0 and also containing the same
deliberate nesting error, you will see that browsers like Netscape 7,
Mozilla and Opera 7 will still render the HTML 4.01 text/html document
to the reader while there is only a parsing error message presented to
the user for the application/xhtml+xml document.

In my view (and others agreeing with that, see
http://www.hixie.ch/advocacy/xhtml
http://www.hut.fi/u/hsivonen/xhtml-the-point
) there is no point in authoring XHTML if you want to send text/html to
the main browsers, there is with HTML 4.01 a well-defined and powerful
document type (actually there are three variants) for that content type,
you can author your HTML to a specific document type and validate your
documents to it. The most important move people see for document
authoring is to write well-structured documents using the right elements
for their semantics (e.g. a blockquote for a quote and not for any wish
to indent some text) and separate the structure from the presentation,
that can be achieved with HTML 4.01 strict and the use of CSS stylesheets.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top