1 (edited by Sander D. 2005-01-02 13:15)

Topic: Why XHTML?

The new version of PunBB is great, but why is it using XHTML? Here are some reasons not to use it:

? PunBB isn't using XML, so you're not using the advantages of XHTML.
? It needs more code. Compare an XHTML page to the smaller HTML page. The difference is more than 2 kilobytes, and that will be more on other pages. I thought you didn't want to have huge HTML pages?
? You aren't using it the right way; XHTML should have the MIME type "application/xhtml+xml" and now that's "text/html". But you shouldn't use "application/xhtml+xml" either, because some browsers don't accept it.

Re: Why XHTML?

Sander D. wrote:

? PunBB isn't using XML, so you're not using the advantages of XHTML.

XHTML is a specification of a document type in XML.

So, yes, it does.

XHTML 1.0 (this specification) is the first document type in the XHTML family. It is a reformulation of the three HTML 4 document types as applications of XML 1.0 [XML]. It is intended to be used as a language for content that is both XML-conforming and, if some simple guidelines are followed, operates in HTML 4 conforming user agents.

-------------------------------------------------------

Sander D. wrote:

? It needs more code. Compare an XHTML page to the smaller HTML page. The difference is more than 2 kilobytes, and that will be more on other pages. I thought you didn't want to have huge HTML pages?

as soon as you style the output of your pages to look the same in all modern browsers, the difference is dramatic, but not in the way that you propose.

the power of xhtml + css is well documented and really without argument these days.


-------------------------------------------------------

Sander D. wrote:

? You aren't using it the right way; XHTML should have the MIME type "application/xhtml+xml" and now that's "text/html". But you shouldn't use "application/xhtml+xml" either, because some browsers don't accept it.

from the top of this page you're looking at right now...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>PunBB.org Forums / Why XHTML?</title>

and from the page at the w3.org you linked

This document summarizes the best current practice for using various Internet media types for serving various XHTML Family documents. In summary, 'application/xhtml+xml' SHOULD be used for XHTML Family documents, and the use of 'text/html' SHOULD be limited to HTML-compatible XHTML 1.0 documents. 'application/xml' and 'text/xml' MAY also be used, but whenever appropriate, 'application/xhtml+xml' SHOULD be used rather than those generic XML media types.

so, there's nothing wrong with 'text/html' for xhtml 1.0 strict.

what's wrong with the way it's implemented here?

3 (edited by Sander D. 2004-12-29 21:44)

Re: Why XHTML?

trel1023 wrote:
Sander D. wrote:

PunBB isn't using XML, so you're not using the advantages of XHTML.

XHTML is a specification of a document type in XML. (...) So, yes, it does.

I still don't see any advantages of XML used. The posts aren't (and shouldn't be) stored in XML files or something like that.

trel1023 wrote:

the power of xhtml + css is well documented and really without argument these days.

There is no difference between XHTML and (valid) HTML for CSS.

4 (edited by Connorhd 2004-12-29 21:50)

Re: Why XHTML?

w3c wrote:

* XHTML documents are XML conforming. As such, they are readily viewed, edited, and validated with standard XML tools.
* XHTML documents can be written to operate as well or better than they did before in existing HTML 4-conforming user agents as well as in new, XHTML 1.0 conforming user agents.
* XHTML documents can utilize applications (e.g. scripts and applets) that rely upon either the HTML Document Object Model or the XML Document Object Model [DOM].
* As the XHTML family evolves, documents conforming to XHTML 1.0 will be more likely to interoperate within and among various XHTML environments.

The XHTML family is the next step in the evolution of the Internet. By migrating to XHTML today, content developers can enter the XML world with all of its attendant benefits, while still remaining confident in their content's backward and future compatibility.

XHTML was created to replace html and the reasons above are the reasons for it

Re: Why XHTML?

Sander D. wrote:

I still don't see any advantages of XML used. The posts aren't (and shouldn't be) stored in XML files or something like that.

"It is intended to be used as a language for content that is both XML-conforming and, if some simple guidelines are followed, operates in HTML 4 conforming user agents"

"Programming is like sex: one mistake and you have to support it for the rest of your life."

6

Re: Why XHTML?

The difference in size is an illusion. Your XHTML file is fully indented and has white space between items and your HTML does not. Remove the indenting/whitespace and the size differenc is only 0.6k

Re: Why XHTML?

W3C wrote:

XHTML documents can be written to operate as well or better than they did before in existing HTML 4-conforming user agents as well as in new, XHTML 1.0 conforming user agents.

Well, the pages operate as well as HTML pages in all user agents, so there still are no advantages. They only are bigger.

W3C wrote:

XHTML documents can utilize applications (e.g. scripts and applets) that rely upon either the HTML Document Object Model or the XML Document Object Model [DOM].

PunBB isn't using any scripts or applets, and if you want to use JavaScript, it will support HTML pages as well as XHTML pages.

W3C wrote:

The XHTML family is the next step in the evolution of the Internet. By migrating to XHTML today, content developers can enter the XML world with all of its attendant benefits, while still remaining confident in their content's backward and future compatibility.

This is more something for static web pages, which take more time to change. When web browsers only support XHTML (which will never happen, or at least take many years), you could change the PHP scripts to output XHTML pages.

Paul wrote:

The difference in size is an illusion. Your XHTML file is fully indented and has white space between items and your HTML does not. Remove the indenting/whitespace and the size differenc is only 0.6k

You're right, I was removing some other unnecassary things too. But 0.6 kB still is something, and at bigger forums and other pages it will be more. Why should you make pages bigger than needed? I like the idea of having small, valid HTML pages.

Re: Why XHTML?

0.6kb... its nothing who cares, one of the major things in 1.2 is not that its xhtml its that tables are not used for layout which allows for huge amounts of styling etc, if you call 1.2 html rather than xhtml it is still the same size just not as good since anything that supports html will support xhtml and in theory other devices/applications would be much happier with xhtml so the real question is why not xhtml?

Re: Why XHTML?

One advantage of using XHTML is website integration. You'll have a hard time finding modern websites using anything but XHTML and if the forums were then HTML, you'd have a problem.

BTW. PunBB uses JavaScript in many ways. Autofocus of form elements, form validation, some redirects in the admin interface etc.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

10

Re: Why XHTML?

Rickard wrote:

One advantage of using XHTML is website integration. You'll have a hard time finding modern websites using anything but XHTML and if the forums were then HTML, you'd have a problem.

Yes, my dynamic websites are all XHTML 1.0 Strict.

I welcome the new DOCTYPE and the ease of customizing the look and feel of Pun.

By the way, shouldn't we have had this discussion months ago?

Re: Why XHTML?

Rickard wrote:

One advantage of using XHTML is website integration. You'll have a hard time finding modern websites using anything but XHTML and if the forums were then HTML, you'd have a problem.

What would be the problem? You can easily have an HTML forum with an XHTML site.

Rickard wrote:

BTW. PunBB uses JavaScript in many ways. Autofocus of form elements, form validation, some redirects in the admin interface etc.

But those scripts wouldn't have to be changed for HTML. The DOM is the same.

hcgtv wrote:

I welcome (...) the ease of customizing the look and feel of Pun.

Me too, but that has got nothing to do with XHTML.

hcgtv wrote:

By the way, shouldn't we have had this discussion months ago?

Some months ago, I was making my sites XHTML too. I've just found out that HTML was actually as good as XHTML, and I didn't want to slow down the release of PunBB 1.2 by starting such a discussion.

But maybe you're right. PunBB at least outputs valid code.

Re: Why XHTML?

Rickard wrote:

You'll have a hard time finding modern websites using anything but XHTML

I am sorry but you are wrong with that one. Most corporate sites will use html and many of them are modern.

A few things. In an ideal world all browsers would have full support for the correct mime type. They would all render pages in the same way. So everyone could use valid xhtml.

Both xhtml and html pages have their place.

Anne Van Kesteren wrote:

Although for some people XHTML 1.1 seems a bit stricter because it doesn't allow the NAME attribute to be used as fragment identifier reference anymore it is actually more limiting. As it, for example, does not support the ID attribute on the HTML element, which can be useful in some projects. (Browsers do support it; the DTD just does not allow it.)

Anne talks allot about the subject. His site is a good read.

A place for xhtml: a site that can grantee 100% valid markup. A site that will not exceed its maximum bandwidth (or doesn't care) so can have slightly larger pages.

A place for html:
- a site for optimisation that uses as few tags and space as it can as needs to keep under bandwidth
- a site where the owner doesn't care about markup. As html allows lose invalid markup.

The (x)html argument will go on for ages. This forum has been built with xhtml and in a way I feel it should.

Eddie

Re: Why XHTML?

but the reason the pages are bigger is not that its xhtml its that it uses divs not tables... i don't think that was done for xhtml i think that was done for the css and style side of it

Re: Why XHTML?

ya when i was trying to code my site along time ago using xhtml i was like wtf, this is so annoying tongue but its worth it.
most of its getting the tags right like ending with /> instead of \> (i see that the title on this page is wrong it needs the /> UNLESS im mistaken, use the validate form on w3 to make sure. and not only that but the header and the use of DIV's mainly.

i had a problem using div's in the past because they would come out all whacko in certain browsers, but i think its a ok now, tho i havent done any web coding or deisgns in a long while so im not sure.

xhtml is the future and things being made should represent that, plus xhtml is more of a standard you should follow, meaning things have to be coded correctly, meaning they should show up correctly every time and a browser only has to render it one way instead of making up for mistakes, much like IE does to websites sad as stated above, "html allows lose invalid markup" xhtml doesnt, meaning its a better standard and if a browser is setup to run that standard their should be no probelms and should be faster at producing the page.

but dont listen to me tongue

Re: Why XHTML?

most of its getting the tags right like ending with /> instead of \> (i see that the title on this page is wrong it needs the /> UNLESS im mistaken, use the validate form on w3 to make sure. and not only that but the header and the use of DIV's mainly.

you only do a /> if the tag doesn't close e.g.
<br> doesn't have a </br> so it becomes <br />
<a> has a </a> so it says as <a>
nothing ever uses \> does it?

16

Re: Why XHTML?

with over 8 years of experience, never saw \> though.

Btw just as a note, if you master CSS or use any good tools, you can have full control over any tags.

Why use xhtml, the biggest answer is for compatibility with newer devices like cellphone or handheld devices.  But as I think even those will continue to support html for many many years to come.  But anyway, like someone said before, why not.

Software is like sex, it's better when it's free.

Re: Why XHTML?

Arf'

PunBB may be the only forum software to use semantic html (by the way of xhtml strict, in this case), and this is why we love it. Semantic html is a LOT easier to write, to maintain, to handle, and way more efficient and bandwith saving.

Re: Why XHTML?

ohh lmao, its been a long time, your right tongue lol i just got messed up with it all, see how i said i hated converting things to xhtml tongue

19

Re: Why XHTML?

xhtml is the future ...

see http://www.csszengarden.com and you understand for webdesigners like me XHTML is future.

But continue with tables if you want : if you want big great HTML code, use PHPBB, simply.

20 (edited by Sander D. 2005-01-02 10:39)

Re: Why XHTML?

edduddiee wrote:
Anne Van Kesteren wrote:

Although for some people XHTML 1.1 seems a bit stricter because it doesn't allow the NAME attribute to be used as fragment identifier reference anymore it is actually more limiting. As it, for example, does not support the ID attribute on the HTML element, which can be useful in some projects. (Browsers do support it; the DTD just does not allow it.)

Anne talks allot about the subject. His site is a good read.

You're quoting the wrong text; this is about XHTML 1.1. You'd better read The future of HTML (HTML isn't dead! The WHATWG is still working on a new version, which will probably be very useful for a forum system!). Or read what Mozilla writes about it:

Serving valid HTML 4.01 as text/html ensures the widest browser and search engine support.

edduddiee wrote:

A place for xhtml: (...) A site that will not exceed its maximum bandwidth (or doesn't care) so can have slightly larger pages.

Well, PunBB should be as small as possible (but use HTML correctly), in my opinion. If I wanted to have larger pages, I'd use phpBB, which will use XHTML 1.0 too.

edduddiee wrote:

html allows lose invalid markup.

That doesn't mean that PunBB would use invalid markup.

mindlessoath wrote:

(...) xhtml is more of a standard you should follow, meaning things have to be coded correctly, meaning they should show up correctly every time and a browser only has to render it one way instead of making up for mistakes, much like IE does to websites

Very few browsers support XHTML. Most browsers just think it's invalid HTML (with strange slashes in the <br>-tag etc.), and handle it the same way as it would handle HTML. Every web browser supports HTML. Not using optional tags like </p> won't cause browsers to render the page the wrong way.

Rod wrote:

see http://www.csszengarden.com and you understand for webdesigners like me XHTML is future.

I already wrote that CSS doesn't handle XHTML differently than HTML. CSS Zen Garden is only about CSS and valid used HTML.

Rod wrote:

But continue with tables if you want : if you want big great HTML code, use PHPBB, simply.

I wasn't talking about using tables! I like it that PunBB is using HTML more correctly now. XHTML only is an XML version of HTML; the tags are the same, but you should code it like XML (so every tag has to be closed).

Re: Why XHTML?

Sander D. wrote:

What would be the problem? You can easily have an HTML forum with an XHTML site.

And how would you do that? Using a frame for the forums or what? I'm talking about websites that integrate their forums into the design of the rest of the website. They have their own dynamically generated header and footer etc.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Why XHTML?

What's the point of arging over this ? It doesn't make sense anymore to do HTML in 2005, get over it big_smile
The choice is so obvious there is no need for any proof nor explanation.

Re: Why XHTML?

Rickard: I didn't know many people were doing it that way. Well, then I guess you're right.

Re: Why XHTML?

I'd say most forums are setup that way. This particular forum is special because I want to show PunBB the way it looks when you install it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

25

Re: Why XHTML?

When used correctly, XHTML is lighter than HTML.

It's suggested to not use table anymore with XHTML for the global display of your site. You should use <div> for blocks(like a cell with HTML), lists(<ul> and <li>) for menus, the headers(h1, h2, h3...) for title and so on...

Of course, XHTML is maybe harder to understand than HTML, but when we know all its advantages, XHTML is better.

Just as an exemple, see at the code of my design here: http://sadike.free.fr/sadike/ftxp/index.html . If you want, try to do the same thing just with HTML and tables.... I'm sure that you couldn't do lighter!