XHTML namespace declararion: needed or not?

T

Toby A Inkster

Micah said:
Can you tell me whether the majority (or, hopefully, all) of
XHTML-aware user agents announce this in their Accept header?

Gecko browsers announce it. Opera announces it from version Opera 7.20
(actually from one of the early betas of 7.20). AFAIK, these are the only
browsers that accept that Content-Type.

You might want to do a compromise of (in hopefully understandable
pseudocode):

if ( contains(http-accept-header,'application/xhtml+xml')
|| pcre_match(user-agent, '/Opera.[6789]/') ) {

outputheader('Content-Type','application/xhtml+xml');

} else {

outputheader('Content-Type','text/html');

}

I think that's more or less how I do it.
Also, is it possible to determine (I'm guessing not) whether,
e.g., XHTML 2.0 is accepted?

No, although both Opera 6+ and Gecko will handle XHTML 2 via their
generic XML+CSS support, as long as you explicitly define styles for all
new XHTML 2 elements. (I have been playing with XHTML 2 a bit)
 
E

Eric B. Bednarz

Micah Cowan said:
I'm using XHTML; All of my XHTML is also 100% valid HTML.

In most situations, that's quite unlikely; and even where it was valid
it would probably *mean* something different.
XHTML
is very unlikely to be recognized "specially" by the majority of
user agents in use today, so I must take pains to ensure that it
is readable by XHTML-unaware agents.

The pain you are taking is rather caused by the futile exercise of
disguising xhtml syntax for use on the web with no benefit at all.

The solution is rather: Don't do that then!
No, and the differences are obvious.

As far as I'm concerned, there's little relevant difference involved.
The fundamental motivation of sending your stuff with the wrong mime
type over the wire relies on UA bugs. Period. The rest is
superstition.
Check out section 5.1 and appendix C, in particular.

Not after dinner, thanks; intellectual short circuits in drool-proof
specs considered harmful.
I don't consider the doctype an "artefact": it is still very much
a part of XML, still very important to validation

Plug: visit the page in my signature with an XHTML capable UA (which
advertises that ability in its accept-header) and locate the bottom of
the page.

And then do the same with, lets say, M$ Losedoze Exploder.
(until
Schemeaas become fully a part of the XML core, replacing DTDs
entirely [not to mention breaking compatibility with SGML]);

Exactly what 'compatibility' with SGML systems would be involved when
you feed XML as text/html to tagsoup manglers anyway?
But YMMV, I guess.

Quite.


Cheers
 
B

Beauregard T. Shagnasty

Eric B. Bednarz pounced upon this pigeonhole and pronounced:
Plug: visit the page in my signature with an XHTML capable UA (which
advertises that ability in its accept-header) and locate the bottom of
the page.

And then do the same with, lets say, M$ Losedoze Exploder.

http://bednarz.nl/

Very! nice site, Eric. Heh, I enjoyed your sense of humor as much as the
site. How about some music samples?

One question: copyrite ? <g> Intentional?
 
M

Micah Cowan

David Dorward said:
Why? HTML is an SGML application. Why should it become an XML parser just
becuase you give it an XML document? (I agree that an HTML/XHTML parser
should, but that isn't what you said)

I didn't say XML document: I said the proper declaration for XML:
meaning the SGML declaration for XML, given at
http://www.w3.org/TR/NOTE-sgml-xml-971215. Given this
declaration, all XML documents are also conforming SGML
documents (see appendix C of the XML spec).

-Micah
 
M

Micah Cowan

Eric B. Bednarz said:
In most situations, that's quite unlikely; and even where it was valid
it would probably *mean* something different.

....such as...? (Note that I am speaking of XHTML 1.0, not
something later/less compatible with HTML 4).
The pain you are taking is rather caused by the futile exercise of
disguising xhtml syntax for use on the web with no benefit at
all.

MMMV. I find benefits from doing so, and the pains are not great.
The solution is rather: Don't do that then!

Why not? W3C does.
As far as I'm concerned, there's little relevant difference involved.
The fundamental motivation of sending your stuff with the wrong mime
type over the wire relies on UA bugs. Period. The rest is
superstition.

It is assuredly not the wrong MIME type: it is specifically
condoned by the relevant specifications.

-Micah
 
E

Eric B. Bednarz

Beauregard T. Shagnasty said:
Very! nice site, Eric.

Thanks for the flowers.
Heh, I enjoyed your sense of humor as much as the
site.

Beware, your social life is endangered then. :-|
How about some music samples?

Someday, in the binary lamespace.
One question: copyrite ? <g> Intentional?

Inventive spelling often provides richer semantics. ;)
The linked resource should make the intention obvious, though I have
some mixed feelings about that, since american copyright obviously isn't
relevant for my site. OTOH, the local (and most european I know of)
situation is essentially similar, and I want a world readable urban
legend slayer, not a legal disclaimer of any sort.
 
E

Eric B. Bednarz

[xhtml *syntax* send as text/html]
MMMV. I find benefits from doing so, and the pains are not great.
It is assuredly not the wrong MIME type: it is specifically
condoned by the relevant specifications.

We could go on forever like this, let me just stress my basic point:

It *is* text/html then, and subsequently correctly treated as such, even
by the few XHTML supporting UAs. In other words, it's ordinary tag soup
(and *not* SGML compatible; OTOH, short of Emacs/w3 I don't know any
HTML UA that can handle shorttag features -- Appendix C demonstrates
perfectly why implementors SHOULD NOT bother reading w3c prose in order
to produce forwards compatible applications; 'nuff said).
 
M

Micah Cowan

David Dorward said:
Do you have a styled version of that? I'm not really in the mood to try to
parse whatever markup dialect that is.

Mozilla doesn't display it properly, I've noticed. Perhaps it's
being sent a different Content-Type than I get with wget
(text/html). It's got an obviously wrong DOCTYPE declaration, so
that may have something to do with it, especially if it's being
sent to Mozilla as application/xhtml+xml.

-Micah
 
D

David Dorward

Micah said:
Mozilla doesn't display it properly, I've noticed. Perhaps it's
being sent a different Content-Type than I get with wget...

A different document too. I think the logic is "Mozilla can handle XML,
therefore we will do client side XSL instead of server side and whoops we
forgot the style sheet."

I'll point another browser at it.
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top