Why does the default theme use XHTML?

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Suggested Hosts
hm2k
Registered User
Posts: 108
Joined: Mon Jun 09, 2003 2:04 pm
Location: UK
Contact:

Why does the default theme use XHTML?

Post by hm2k »

Why not use HTML 4.01?

As far as I am aware there's more reasons not to use XHTML than there is...

Is there any reason why phpBB3 decided to use XHTML over HTML 4.01?

I can't think of any.

Thanks.

SamG
Former Team Member
Posts: 3221
Joined: Fri Aug 31, 2001 6:35 pm
Location: Beautiful Northwest Lower Michigan
Name: Sam Graf

Re: Why does the default theme use XHTML?

Post by SamG »

phpBB tries to follow current standards. People who argue that HTML is still viable aren't interested in current standards so I won't go into that.

I will say that I'm not aware of any negative consequences to using XHTML < XHTML 1.1 so the standards discussion aside, using XHTML 1.0 (which is essentially HTML 4.01 rewritten in XML) hurts nothing that I know of. If that's the case, phpBB in HTML 4.01 becomes an unnecessary effort with no place to go in the future.
We should talk less, and say more.

User avatar
Techie-Micheal
Security Consultant
Posts: 19511
Joined: Sun Oct 14, 2001 12:11 am
Location: In your servers

Re: Why does the default theme use XHTML?

Post by Techie-Micheal »

And one of the negatives of using HTML 4.01 is that you can't take advantage of new functionality. The only reason I can think of to not use XHTML is that people with decrepit browsers won't see it correctly. However, there are more reasons for them to upgrade to a modern browser than support for XHTML ...
Proven Offensive Security Expertise. OSCP - GXPN

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 3619
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Why does the default theme use XHTML?

Post by thecoalman »

Abstract
--------

A number of problems resulting from the use of the text/html MIME type
in conjunction with XHTML content are discussed. It is suggested that
XHTML delivered as text/html is broken and XHTML delivered as text/xml
is risky, so authors intending their work for public consumption
should stick to HTML 4.01, and authors who wish to use XHTML should
deliver their markup as application/xhtml+xml.
http://hixie.ch/advocacy/xhtml

Long discussion here: http://www.webmasterworld.com/forum21/12026.htm
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison

User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: Why does the default theme use XHTML?

Post by A_Jelly_Doughnut »

thecoalman wrote:
Abstract
--------

A number of problems resulting from the use of the text/html MIME type
in conjunction with XHTML content are discussed. It is suggested that
XHTML delivered as text/html is broken and XHTML delivered as text/xml
is risky, so authors intending their work for public consumption
should stick to HTML 4.01, and authors who wish to use XHTML should
deliver their markup as application/xhtml+xml.
http://hixie.ch/advocacy/xhtml

Long discussion here: http://www.webmasterworld.com/forum21/12026.htm
I'm sure this was mentioned in the ww link, but the problem with xhtml+xml is that it doesn't work in practice, particularly with Internet Explorer.
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 3619
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Why does the default theme use XHTML?

Post by thecoalman »

I've been trying to wrap my head around this myself for sometime now.

The main point as i understand it is you're using XHTML doctype but specifying html/text mimetype the browser is parsing the code as HTML 4.01 strict which really negates the point of using XHTML. ;)
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison

SamG
Former Team Member
Posts: 3221
Joined: Fri Aug 31, 2001 6:35 pm
Location: Beautiful Northwest Lower Michigan
Name: Sam Graf

Re: Why does the default theme use XHTML?

Post by SamG »

This is, at its core, a server problem, a delivery problem, old news, and not something even remotely fixed by retreating to HTML 4.01 (or 3.2, my personal favorite). It has nothing to do with the benefits of XML, served appropriately. The whole push for a PHP < 5 boycott to force hosts to upgrade occuring in the same possible world as the one where people are saying that the future of the Web is in HTML really makes me chuckle. Am I the only one seeing the irony here? :)

Additionally, since XHTML 1.0, by standard, may be served as text/html (until such time as the Web gets its collective act together), ramping sites up from XHTML 1.0 to real XML delivery is almost certainly easier than doing the same from HTML 4.01 (or 3.2, my personal favorite).
We should talk less, and say more.

ElbertF
Registered User
Posts: 527
Joined: Thu Mar 11, 2004 9:41 pm
Location: Australia
Contact:

Re: Why does the default theme use XHTML?

Post by ElbertF »

SamG wrote:ramping sites up from XHTML 1.0 to real XML delivery is almost certainly easier than doing the same from HTML 4.01

Code: Select all

header('Content-Type: application/xhtml+xml; Charset=utf-8')
That's about it isn't it? You might want to upgrade to XHTML 1.1 first which requires a few tweaks that you could already apply to 1.0 (except for the content- and doctype).

SamG
Former Team Member
Posts: 3221
Joined: Fri Aug 31, 2001 6:35 pm
Location: Beautiful Northwest Lower Michigan
Name: Sam Graf

Re: Why does the default theme use XHTML?

Post by SamG »

Yeah, I think so. If a person already were writing to XHTML 1.0 Strict, well-formed, valid markup would be in the can. Like you say, depending on one's needs, moving to XHTML 1.1 would be the only real work. And at the point, the potential benefits are pretty clear.

I think people forget that XHTML is a convenience, albeit a powerful one, and not an end in itself. It's there for people who don't need to write their own XML solution. This is in real contrast to HTML.
We should talk less, and say more.

User avatar
AdamR
Former Team Member
Posts: 9731
Joined: Tue Mar 02, 2004 5:40 pm
Location: Tampa, Florida
Name: Adam Reyher
Contact:

Re: Why does the default theme use XHTML?

Post by AdamR »

To add to this discussion, there really isn't even an issue at this point with browsers supporting XHTML 1.1 Strict with the exception of how it's served to the browser. If planned from the beginning stages of design, having exclusively XHTML 1.1 elements is more than possible. Again, moving from XHTML 1.0 served as text/html to XHTML 1.1 Strict served as xml is ridiculously trivial.

Take for example my website. It essentially is fully XHTML 1.1 (as far as validation) with the exception of how it's being served. Browser incompatibilities are not an issue at all unless we take it back to the IE5 days.

Not to mention, as has been said, XHTML 1.0 offers a variety of benefits over HTML 4.01 and pure scalability for the future.

- Adam
phpBB Support: Welcome | Userguide | Knowledge Base | Search
Honored supporter of the phpBB Group!
"If I have seen a little further it is by standing on the shoulders of Giants." - Isaac Newton

User avatar
Ddraiggoch06
Registered User
Posts: 482
Joined: Sun May 18, 2008 11:45 am
Location: Wales, UK

Re: Why does the default theme use XHTML?

Post by Ddraiggoch06 »

All modern browsers recognise XHTML 1.1 (Internet Exploder ignores almost every rule in the book, but it still recognises it). Not just that, but by using XHTML Strict, you have the sense that what you're doing is right and that it is the correct way of doing it, which stops all those bad habits we pick up. XHTML also allows the latest and more advanced functions to be used, and while it is not 100% compatible with older browsers, you can't keep playing it safe all the time.
I accept PM support for phpBB3. Please do not PM me with MOD or Style support and requests.
"Give a man a fish and you'll have fed him for today. Teach a man to fish and you'll have fed him for a lifetime."

hm2k
Registered User
Posts: 108
Joined: Mon Jun 09, 2003 2:04 pm
Location: UK
Contact:

Re: Why does the default theme use XHTML?

Post by hm2k »

Here's what i've learned about XHTML...
All that aside, are we saying that the reason XHTML 1.0 is used is because a) phpBB isn't concerned about compatibility and b) that XHTML is likely to be the future of markup...? Surly we can do better than that?

User avatar
Phil
Former Team Member
Posts: 10403
Joined: Sat Nov 25, 2006 4:11 am
Name: Phil Crumm
Contact:

Re: Why does the default theme use XHTML?

Post by Phil »

None of those sources are anyone that'd be considered an "expert", and a lot of the issues have already been addressed in this thread.

As for why XHTML is used, as stated above, it is the future of how content will be presented via the web. And phpBB is concerned about compatibility -- if you server phpBB as xhtml/xml, it'll work fine.
Moving on, with the wind. | My Corner of the Web

SamG
Former Team Member
Posts: 3221
Joined: Fri Aug 31, 2001 6:35 pm
Location: Beautiful Northwest Lower Michigan
Name: Sam Graf

Re: Why does the default theme use XHTML?

Post by SamG »

Yeah, all that aside indeed. Can you show me one real-world problem in either IE6 or IE7 that XHTML introduces into the Web experience? I'm not talking about CSS issues, mind you, but about markup issues. Can you show me what template authors (including phpBB's developers) will gain by using HTML 4.01? I'm not interested in theory here, but in real examples, real demonstrations. For example, it would impress me greatly if instead of starting this discussion you wrote an HTML 4.01 strict style and demonstrated the benefits over using XHTML 1.0 markup.

I have long found it unfair (and increasingly irrelevant) that people argue against XHTML on technical grounds, then criticize people who attempt to use XHTML because they are trying to follow technical guidelines. This isn't Ford versus Chevy, Hulk versus Thing, after all. It's not about some blind preference or some blind allegiance. If it were, by now all the XHTML zombies would be delivering XHTML 1.1 as text/html. And that isn't the case. Those who characterize, either explicitly or implicitly, users of XHTML as in some way thoughtless about the technical issues involved really ought to think again about what they're suggesting.
We should talk less, and say more.

ElbertF
Registered User
Posts: 527
Joined: Thu Mar 11, 2004 9:41 pm
Location: Australia
Contact:

Re: Why does the default theme use XHTML?

Post by ElbertF »

hm2k wrote:[*]To get maximum reach and to maintain compatibility, HTML 4.01 should be used.
For even more compatibility you could serve web pages as plain text.
hm2k wrote:phpBB isn't concerned about compatibility
XHTML is more compatible then HTML since it will also work in XML browsers. phpBB works well in all major browsers including Internet Explorer 6, it even accessible through text based browsers and screen readers. Can you provide an example of a browser that breaks phpBB because of XHTML?

Post Reply

Return to “phpBB Discussion”