Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > XHTML namespace declararion: needed or not?

Reply
Thread Tools

XHTML namespace declararion: needed or not?

 
 
Toby A Inkster
Guest
Posts: n/a
 
      10-17-2003
Micah Cowan wrote:

> Toby A Inkster <(E-Mail Removed)> writes:
>
>> A nice compromise is to serve at application/xhtml+xml to browsers that
>> accept it, and text/html to others.

<snip>
>> A better way is to look at the Accept HTTP header.

>
> 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)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?id=132

 
Reply With Quote
 
 
 
 
Eric B. Bednarz
Guest
Posts: n/a
 
      10-18-2003
Micah Cowan <(E-Mail Removed)> writes:

> Eric B. Bednarz <(E-Mail Removed)> writes:


>> If you're not using XHTML, that's not surprising, is it?

>
> 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!

>> Some of the numerous problems with css only seem to appear in certain
>> UAs under certain conditions if you send it as text/css. It would be
>> much safer then to advertise it as text/plain, no?

>
> 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.

>> The question, if any, is rather why you would want to omit the namespace
>> rather than the doctype declaration artefact once you've jumped on the
>> XHTML bandwaggon.

>
> 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

--
http://bednarz.nl/
 
Reply With Quote
 
 
 
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      10-18-2003
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?

--
-bts
-This space intentionally left blank.
 
Reply With Quote
 
Micah Cowan
Guest
Posts: n/a
 
      10-19-2003
David Dorward <(E-Mail Removed)> writes:

> Micah Cowan wrote:
>
> > Any HTML parser which *truly* understands SGML should be given
> > the proper declaration for XML... and voila! It's an XML
> > parser.

>
> 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
 
Reply With Quote
 
Micah Cowan
Guest
Posts: n/a
 
      10-19-2003
Eric B. Bednarz <(E-Mail Removed)> writes:

> Micah Cowan <(E-Mail Removed)> writes:
>
> > Eric B. Bednarz <(E-Mail Removed)> writes:

>
> >> If you're not using XHTML, that's not surprising, is it?

> >
> > 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.


....such as...? (Note that I am speaking of XHTML 1.0, not
something later/less compatible with HTML 4).

> > 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.


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.

>
> >> Some of the numerous problems with css only seem to appear in certain
> >> UAs under certain conditions if you send it as text/css. It would be
> >> much safer then to advertise it as text/plain, no?

> >
> > 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.


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

-Micah
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      10-19-2003
Micah Cowan wrote:

> 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.


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

--
David Dorward http://dorward.me.uk/
 
Reply With Quote
 
Eric B. Bednarz
Guest
Posts: n/a
 
      10-20-2003
Beauregard T. Shagnasty <(E-Mail Removed)> writes:

>> http://bednarz.nl/

>
> 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.


--
http://bednarz.nl/
 
Reply With Quote
 
Eric B. Bednarz
Guest
Posts: n/a
 
      10-20-2003
Micah Cowan <(E-Mail Removed)> writes:

[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).



--
http://bednarz.nl/
 
Reply With Quote
 
Micah Cowan
Guest
Posts: n/a
 
      10-20-2003
David Dorward <(E-Mail Removed)> writes:

> Micah Cowan wrote:
>
> > 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.

>
> 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
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      10-21-2003
Micah Cowan wrote:

> David Dorward <(E-Mail Removed)> writes:
>
>> Micah Cowan wrote:
>>
>> > 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.

>>
>> 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...


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.



--
David Dorward http://dorward.me.uk/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PSD to XHTML Conversion, PSD to HTML, Joomla, Drupal, WordpressConversion, PSD to XHTML CSS xhtml champs XML 0 08-02-2011 05:40 AM
PSD to XHTML Conversion, PSD to HTML, Joomla, Drupal, WordpressConversion, PSD to XHTML CSS xhtml champs C Programming 0 08-01-2011 06:29 AM
convert xhtml to another xhtml using xslt Usha2009 XML 0 12-20-2009 01:13 PM
Should I Convert Site To XHTML or XHTML mobile? chronos3d HTML 9 12-05-2006 04:46 PM
parse URL (href) from xhtml, xhtml -> text, for data hawat.thufir@gmail.com XML 7 02-08-2006 07:39 PM



Advertisments