What is XHTML?

B

Bernhard Sturm

Steve said:
What do these user agents do when presented with a page that is not
well-formed XHTML?

the page will not being rendered...

What do they do when presented with a page that is
not valid XHTML?

the page will not being rendered...

What do they do when presented with a page that is

the page will not being rendered...

I'm really curious because there are very few XHTML pages on the
web, and even fewer valid, well-formed ones. So how much of the web
can such browsers access?

a few.
all of these discussions are always a bit like wagging the dog. I know
it's a pain in the ass, but if you have rules (reading standards), you
shall not bend them to your own needs ;-)
many webauthors say: 'the browser is rendering even badly nested HTML
perfectly, although it's not recommended by W3C and non-standardised,
non-valid code, it's perfectly working in 90% of all browsers, hence
it's valid for my own purpose and the targeted audience!'
But then comes the day, when certain UAs emerge that have, for the sake
of accessibilty, implemented the W3C standards, suddenly those HTML
quirk mode pages will no longer work... Now, who are you going to blame?
The UA which is running in XHTML strict mode not trying to 'guess' what
the author wanted with his/her code (as does ATM IE6.x) or the author
who was just too lazy to adopt to a new standard?
Those guessing HTML UAs are a real pain, because you can code your page
in a very bad manner (using uppercase tags, using badly nested
arguments), and people tend to think, that this is great, as the browser
is rendering the page perfectly.
All this reminds me of the old Pascal vs Basic discussion. Both were
valid and powerful languages. Pascal forced the user to declare
variables, Basic didn't. A lot programmers said: Basic is more flexible
as the language let us the freedom to introduce variables where ever we
want. However, they usually forgot how difficult it was to debug a Basic
source where every 5th line you introduce randomly a new variable (and
don't forget the misspelled var names).
I personally don't care if people favour HTML instead of XHTML, as I
tend to stick more on the secure side: if XHTML forces me to use
lowercase (which complies with my usual programming habits where a
variable name TimeStamp is not the same as timestamp), and forces me to
nest my tag structure in a well-formed manner, then I am in. (don't
forget: you CAN do this as well in HTML, but it's you, the human author,
who has to enforce it. One mistake, and your HTML code will still
render. One mistake in XHTML and your code is non-valid.)
I leave it to you to judge. :)

cheers
bernhard

www.daszeichen.ch
remove nixspam to reply
 
S

Steve Pugh

Bernhard Sturm said:
What do they do when presented with a page that is
What do they do when presented with a page that is

the page will not being rendered...

So you have a WAP phone that is okay for browsing a private network
that only uses well-formed, valid XHTML but which is mostly useless
for browsing the WWW?
all of these discussions are always a bit like wagging the dog. I know
it's a pain in the ass, but if you have rules (reading standards), you
shall not bend them to your own needs ;-)

HTML 4.01 is every bit as much a standard as XHTML 1.0 or 1.1.
(In other words, not at all - the only version of HTML that can be
called a standard is ISO/IEC 15445:2000.)
many webauthors say: 'the browser is rendering even badly nested HTML
perfectly, although it's not recommended by W3C and non-standardised,
non-valid code, it's perfectly working in 90% of all browsers, hence
it's valid for my own purpose and the targeted audience!'

I'm not one of those authors. I write valid code, whether it's HTML or
XHTML.
And how is that relevant to valid HTML vs valid XHTML?
But then comes the day, when certain UAs emerge that have, for the sake
of accessibilty, implemented the W3C standards, suddenly those HTML
quirk mode pages will no longer work... Now, who are you going to blame?

That's a funny definition of accessibility. Accessibility should
include making a good attempt at rendering invalid pages.

Where have I advocated writing invalid code? Stop trying to distort my
viewpoint.
The UA which is running in XHTML strict mode not trying to 'guess' what
the author wanted with his/her code (as does ATM IE6.x) or the author
who was just too lazy to adopt to a new standard?

Expecting authors to go back and change pages written ten years ago is
not realistic. HTML is here to stay for the forseeable future. Any UA
which does not support HTML is going to have major problems
penetrating gaining a user base.
Those guessing HTML UAs are a real pain, because you can code your page
in a very bad manner (using uppercase tags,

There is nothing wrong with using uppercae element names. It's merely
an artifact of XML syntax that element names are case sensitive. The
drafters of XHTML could easily have picked uppercase over lowercase.

Trying to say that XHTML is good because it forces lower case element
names is just daft. It's not a benefit, it's just a side effect of
using XML rather than SGML syntax.
I personally don't care if people favour HTML instead of XHTML, as I
tend to stick more on the secure side: if XHTML forces me to use
lowercase (which complies with my usual programming habits where a
variable name TimeStamp is not the same as timestamp),

Different languages have different requirements. Some require upper
case, some require lower case, some require mixed case, some don't
care. You seem to want to use one rule for all languages. That would
be nice, but ain't never gonna happen.
and forces me to nest my tag structure in a well-formed manner,

There's more to XML well-formedness than element nesting, and yes it's
true that an HTML document can not be well formed unless it contains
no empty elements. But unless an XML-parser is reading your documents
well-formedness is not a big deal. And XHTML browsers are not the same
as full XML-parsing engines.

Improper nesting of elements is just as forbidden in HTML as it is in
XHTML.
(don't forget: you CAN do this as well in HTML, but it's you, the
human author, who has to enforce it. One mistake, and your HTML
code will still render. One mistake in XHTML and your code is non-valid.)

You're not comparing like with like. "HTML code will render" vs "XHTML
is non-valid". How about validating your HTML and checking the
rendering of XHTML in browsers?

Steve
 
B

Bernhard Sturm

Steve said:
So you have a WAP phone that is okay for browsing a private network
that only uses well-formed, valid XHTML but which is mostly useless
for browsing the WWW?

yepp... WAP2.0 browser, it doesn't bother me, as the major websites I
use (news/online timetables/info sites) are all in XHTML Basic.
I'm not one of those authors. I write valid code, whether it's HTML or
XHTML.

I didn't mean you... I was trying to give a general view of the
arguments many web authors I know are throwing into such a discussion...
That's a funny definition of accessibility. Accessibility should
include making a good attempt at rendering invalid pages.

I don't think so. I pledge for quality on the web. If we have browsers
rendering even invalid pages, then we will never see the end of the
browser wars. It's the author who should take care that his or her page
is valid. The author has to ensure the quality of the pages he or she
releases to the WWW. If an author relies on UAs rendering cluttered
code, then we will always have statements like: "But my goodness, with
IE it looked perfectly okay, so the damn Opera is just a crap browser
because its rendering my pages badly!"
I am sure you get the drift :)
Where have I advocated writing invalid code? Stop trying to distort my
viewpoint

I never said, that you were advocating this or that. I am just trying to
discuss the possible viewpoints of various exponents on this issue.
Don't take NG discussions too personal :)
Trying to say that XHTML is good because it forces lower case element
names is just daft. It's not a benefit, it's just a side effect of
using XML rather than SGML syntax.

I never said it's good :) I was just pointing to the fact, that I like
it, if a language has some restraints helping authors to focus on
sleaker code. If that's good or bad, is up to the author using the
language.
There's more to XML well-formedness than element nesting, and yes it's
true that an HTML document can not be well formed unless it contains
no empty elements. But unless an XML-parser is reading your documents
well-formedness is not a big deal. And XHTML browsers are not the same
as full XML-parsing engines.

but what about online help viewer based on XML parsers? they will be
able to render a XHTML document, but not a HTML document.
Improper nesting of elements is just as forbidden in HTML as it is in
XHTML.

yes you are entirely right, all I wanted to say is that there are people
outside (please don't think I always mean you :), who feel more
comfortable with HTML because their favourite browser is more forgiving
with HTML as when they set their DTD to XHTML. I know some of those
webdesigners (it's not you, it's a friend of mine). After lengthy
discussions I realised, that he does not feel comfortable with learning
new things (e.g. standards), he likes it more if he can tweak the HTML
code around the browsers capabilities.
And hence my comparisons of BASIV vs. PASCAL (I had these discussions 15
years ago)
And don't think that I would like all languages look the same. I am just
a poor European who believes in the beauty of regulations, hence I am
favouring the end of the browser wars with a more restrictive approach...

bernhard
 
W

William Tasso

Steve said:
...
Different languages have different requirements. Some require upper
case, some require lower case, some require mixed case, some don't
care. ...

.... and then there's Fortran which, IIRC, even has/had a preference for
which column the code starts in.
 
J

Jukka K. Korpela

William Tasso said:
... and then there's Fortran which, IIRC, even has/had a preference
for which column the code starts in.

Had. And it was not a preference. Code starts at column 7 and continues
up to and including column 72. No fussy "preferences" or "style"
or "recommendations". And real programmers still use FORTRAN, don't we?

And then there's Python, which uses indentation meaningfully and not
just to mislead people.

In most programming languages, as well as in many markup languages,
the common _style_ is to use indentation to indicate structure. As in

<html>
<head>
<title>...</title>
<meta ...>
</head>
<body>
<h1>...</h1>
etc.

And this often fools people into thinking that the indentation matters.
Sooner or later they forget the tags, semicolons, and braces, or
whatever.

Python makes indenting _significant_ by language rules, and thereby
reduces unnecessary syntactic rubbish.

Now all praise XML, which makes the syntactic rubbish absolutely
obligatory and which was still designed to be a vulgar variant of SGML,
restricted to simplistic data structures that could well be expressed
using indentation and keywords only.
 
T

Toby A Inkster

Jukka said:
Had.

And then there's Python, which uses indentation meaningfully and not
just to mislead people.

As does Haskell. And Postfix config files. :)
 
M

Matthias Gutfeldt

Steve said:
That's a funny definition of accessibility. Accessibility should
include making a good attempt at rendering invalid pages.

Agreed. It's one of the dilemmas of "accessibility" on the WWW. An
accessibility-friendly user agent shouldn't punish its user for somebody
else's mistakes.

What we need is user agents that'll hunt down and kick the author for
every accessibility error it encounters :).


Matthias
 
A

Andy Dingley

So the XML technique allows a really
flexible data structure.

Sadly no. XML is enormously rigid on data structures. It only offers a
tree, from which you can specialise into 2D arrays or lists pretty
easily. For arbitrary graphs though, you're better off with RDF.

Don't be tempted by XML's ID & IDREF attribute types either. Generally
without any specific support and too limited to really be much use.
I've got data for plant species lists that
would be nice to organize in all sorts of varying circular and dendritic
type logical structures

Search the web - plenty of taxo projects already out there. Fishbase
and Tree of Life are some of the better ones.
 
W

Whitecrest

What we need is user agents that'll hunt down and kick the author for
every accessibility error it encounters :).

Actually what one needs is a workable balance between accessibility and
functionality. Some people fail to realize that that balance is a
moving target, and moving to far away in one direction or another can be
bad.
 
M

Marc Nadeau

Paul Furman a écrit:
So should I be learning XML client side rather than monkeying
around connecting to MySQL with PHP server side? I don't want
to waste my time with the old school stuff because I don't
know that at all yet and it looks like it will be a
considerable chore to learn, I might as well dig into what
will be most useful in the future.

IMNSHO xml is not very efficient as a large database storage
format; too much overhead. You have to repeat the field names
into each one of the entries.

A very simple example (not including the DTD):
<customers>

<client class="retailer">
<number>000001</number>
<name>John</name>
<familyName>Doe</familyName>
</client>

<client class="home user">
<number>000002</number>
<name>Jane/name>
<familyName>Donovan</familyName>
</client>

and so on...

</customers>

The field names may sometimes use more storage space than the
actual data. Things get worse if one forces fixed lenght in the
DTD to speed up data retrieval.

But xml is very efficient as a data sharing format due to its
great simplicity (rigor makes things simple). It can be easily
converted to most other formats, including the html variants.

So, the question is not about a choice between using and
learning sql databases or xml transformations.
It's about how to make sql and xml work together efficiently.

Bonne lecture!
 

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,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top