Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-13 18:55:18

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Can I use Textpattern to... output HTML 4.01 code?

That’s is the question.

Can I use Textpattern to output HTML 4.01 valid code? (without hacking the core and without hardcoding too much)

I have reading more than one article this week of people that is switching back from XHTML 1.0 to HTML 4.01.
There are some webdevelopers/designers who I admire (just a little) that did the switch back.
Like Joshuaink (a TXP lover, as far as I know) who said: All my sites from here on will use HTML 4.01. So there!
And more, like Roger Johansson from 456bereastreet.com, and many others goes for HTML 4.01.

Well, this thread is just about the question I asked, and not to discuss the decision about using XTHML or HTML.
But of course, it’s nice to discuss, so do it if you want, but please, someone answer my question first!

Thanks!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#2 2005-11-13 19:16:07

ubernostrum
Member
From: Lawrence, KS
Registered: 2004-05-05
Posts: 238
Website

Re: Can I use Textpattern to... output HTML 4.01 code?

Mark Wubben does HTML 4.01 with TXP, so it’s certainly possible. I need to bug him about how he managed some of that…


You cooin’ with my bird?

Offline

#3 2005-11-13 20:29:19

NyteOwl
Member
From: Nova Scotia, Canada
Registered: 2005-09-24
Posts: 539

Re: Can I use Textpattern to... output HTML 4.01 code?

<blockquote><b>maniqui wrote:</b>
<p><i>Joshuaink (a TXP lover, as far as I know) who said: All my sites from here on will use HTML 4.01. So there!
And more, like Roger Johansson from 456bereastreet.com, and many others goes for HTML 4.01.</i></p></blockquote>

It would have been nice if Joshualink had of shared his reasoning behind such a statement.

Other than the ability to get away some tag and attribute variations that are deprecated in XHTML adn still validate, or to cater to even older browsers, I don’t seen any advantage in using HTML 4.01, especially Transitional over XHTML.


Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;

Offline

#4 2005-11-13 20:39:22

ubernostrum
Member
From: Lawrence, KS
Registered: 2004-05-05
Posts: 238
Website

Re: Can I use Textpattern to... output HTML 4.01 code?

> NyteOwl wrote:
> Other than the ability to get away some tag and attribute variations that are deprecated in XHTML adn still
> validate, or to cater to even older browsers, I don’t seen any advantage in using HTML 4.01, especially
> Transitional over XHTML.

HTML 4.01 and XHTML 1.0 are element-for-element and attribute-for-attribute identical. If something is deprected in HTML 4.01 it is deprecated in XHTML 1.0, and vice-versa.

The advantage to HTML 4.01 is that serving XHTML properly (that is, as MIME-type application/xhtml+xml) doesn’t work with Internet Explorer, introduces extremely strict parsing modes in supporting browsers (yellow screen of death), and changes the way both CSS and the DOM behave. Many well-informed web developers have looked at seen this and chosen to stay at, or revert back to, HTML 4.01 rather than deal with the headaches and workarounds involved in doing XHTML properly at the present moment.

And since HTML 4.01 is still a perfectly valid web standard, I don’t see anything wrong with that position; I’m seriously considering HTML 4.01 for the next iteration of my “business” site.

Last edited by ubernostrum (2005-11-13 20:39:38)


You cooin’ with my bird?

Offline

#5 2005-11-13 21:30:33

ubernostrum
Member
From: Lawrence, KS
Registered: 2004-05-05
Posts: 238
Website

Re: Can I use Textpattern to... output HTML 4.01 code?

And Mark is quick to answer.


You cooin’ with my bird?

Offline

#6 2005-11-14 04:44:38

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,255
Website

Re: Can I use Textpattern to... output HTML 4.01 code?

I did try Mark’s method when he first talked about this (in response to my question). I did run into problems, though, mostly related to comments forms. And I needed to go into the textpattern files to edit comments.php and some more, which I wanted to avoid.

I’m now testing adding a snipped of PHP right before the DTD in my txp templates to strip the />.

Here is the code: @< ?php
ob_start (“ob_gzhandler”);
$charset = “utf-8”;
$mime = “text/html”;
function fix_code($buffer) {
return (preg_replace(“!\s*/>!”, “>”, $buffer));
}

ob_start(“fix_code”); $prolog_type = “< !DOCTYPE html PUBLIC \”-//W3C//DTD HTML 4.01//EN\” \“http://www.w3.org/TR/html4/strict.dtd\” >\n<html lang=\“ja\”>\n”;

header(“Content-Type: $mime;charset=$charset”);
header(“Vary: Accept”);
print $prolog_type;
? >@

Added some white space here and there to avoid textile swallowing code.

Use it in a form, and of course make sure all your templates use valid html 4.01…


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#7 2005-11-14 10:42:40

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Can I use Textpattern to... output HTML 4.01 code?

Sounds like one of those “fashions” of people striving to be against the flow.
It’s explicitly allowed to serve XHTML1.0 transitional with text/html.. But then again, the talk is not about “valid”, but about “proper”, which everybody is free to define as one likes. Reminds me a little bit of the “funky” feeds meme.

Offline

#8 2005-11-15 02:16:16

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Can I use Textpattern to... output HTML 4.01 code?

Thanks all for sharing ideas and thoughts. Keep coming.

If the only change to revert back to HTML 4.01 is to close tags in a different way (> instead of />), maybe a simple option as a radio button in TXP admin-side could do the job and make happpy everybody.
Something like:
“I want TXP to output:
- XHTML
- HTML

And then, the TXP user just add the doctype that he/she wants to use.

Aside that, I also share a similar feeling when Sencer says “Sounds like one of those “fashions” of people striving to be against the flow

But of course, that people striving agains the flow have my admiration for their work (specially Roger Johansson).
So I try to hear and learn from what they say and do in their own sites.

Also, as I understand, one day all browsers will support application/xhtml+xml.
And that day, when we will send our sites as application/xhtml+xml, we will be exposed to the “yellow screen of death”, or am i wrong?

I would say that when that day arrives, most people that publish on the web will prefer to have a HTML 4.01 site than a XHTML site.
The idea that a visitor (or even the site owner) makes a mistake (a malformed tag) in a comment and that brings a yellow screen of death is enough to scare some enthusiasts like me.

I dont know if that is the way the things will follow. I dont even know if what i’m saying is correct.
But of course I want to make some right decisions from now.

BTW, I think I will keep using XHTML.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#9 2005-11-15 03:49:36

NyteOwl
Member
From: Nova Scotia, Canada
Registered: 2005-09-24
Posts: 539

Re: Can I use Textpattern to... output HTML 4.01 code?

<blockquote>
<b>ubernostrum wrote:</b>

HTML 4.01 and XHTML 1.0 are element-for-element and attribute-for-attribute identical. If something is deprected in HTML 4.01 it is deprecated in XHTML 1.0, and vice-versa.
</blockquote>

Regarding deprecated and supported, and using the IMG tag as an example; the <i>align, border, hspace, vspace</i> attributes of the image element were deprecated in HTML 4.01 but are not supported at all in XHTML 1.0 Strict DTD.

<blockquote>
<b>ubernostrum wrote:</b>

Many well-informed web developers have looked at seen this and chosen to stay at, or revert back to, HTML 4.01 rather than deal with the headaches and workarounds involved in doing XHTML properly at the present moment.
</blockquote>

I can understand wishing to avoid the headaches that incompatibilities can induce. At the same time, catering to those pieces of software that promote and/or perpetuate such incompatibilities simply encourges further such incompatibilities. People go out of their way to come up with hacks to make IE function properly with standards (which shouldn’t be necessary). And as long as this kind of catering to such requiremetns continues, it will never change.

In the end, as with many such things, it’s a personal preference.


Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;

Offline

#10 2005-11-15 03:59:36

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,255
Website

Re: Can I use Textpattern to... output HTML 4.01 code?

> maniqui wrote:

If the only change to revert back to HTML 4.01 is to close tags in a different way (> instead of />), maybe a simple option as a radio button in TXP admin-side could do the job and make happpy everybody.
Something like:
“I want TXP to output:
- XHTML
- HTML

That is a nice idea… :-) Feature request ?

Also, as I understand, one day all browsers will support application/xhtml+xml.
And that day, when we will send our sites as application/xhtml+xml, we will be exposed to the “yellow screen of death”, or am i wrong?

You are correct. A slight mistake in the markup, and you get an error warning. But you’ve probably already read enough on the subject.

I would say that when that day arrives, most people that publish on the web will prefer to have a HTML 4.01 site than a XHTML site.
The idea that a visitor (or even the site owner) makes a mistake (a malformed tag) in a comment and that brings a yellow screen of death is enough to scare some enthusiasts like me.

Partly (mostly…), it is up to the content managment system to catch those errors, and output valid mark-up. Bye and bye, Textpattern does a good job at that (I made a plugin that outputs application/xthml+xml, you can test your self). Of course, if the people who input content in a site use handcoding of mark-up, things can still go wrong. Visitor input is still a bit tricky on the edges, but those should also be catched by the system. Bye the time the big boy among browsers (IEW) catches up, I guess we’ll have figured out better techniques to catch up on those egde cases.

Or we will be using HTML 5 intensively (see the What WG), which is where I see the future at the moment.

- – - -

When I develop commercial sites, I always use html 4.01 strict. For personal sites, I favor application/xhtml+xml, as a matter of taste (and I like to break browsers with that …).
The next TXP powered site I develop will be using HTML 4.01 strict.
I never use transitional doc types, that is tag soup parsing ‘par excellence’.

Last edited by phiw13 (2005-11-15 04:04:14)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#11 2005-11-15 06:27:51

ubernostrum
Member
From: Lawrence, KS
Registered: 2004-05-05
Posts: 238
Website

Re: Can I use Textpattern to... output HTML 4.01 code?

> NyteOwl wrote:
> Regarding deprecated and supported, and using the IMG tag as an example; the <i>align, border, hspace,
> vspace</i> attributes of the image element were deprecated in HTML 4.01 but are not supported at all in
> XHTML 1.0 Strict DTD.

Elements which are deprecated in HTML 4.01 are disallowed in HTML 4.01 Strict as well. Again, XHTML 1.0 and HTML 4.01 are identical except for syntax.

> I can understand wishing to avoid the headaches that incompatibilities can induce. At the same time, catering
> to those pieces of software that promote and/or perpetuate such incompatibilities simply encourges further such
> incompatibilities. People go out of their way to come up with hacks to make IE function properly with standards
> (which shouldn’t be necessary). And as long as this kind of catering to such requiremetns continues, it will
> never change.

As long as people are using IE in significant numbers, we’ll have to make sure that things at least work on a basic level. But I’m a big fan of progressive enhancement as the way forward.

And like Philippe, I’m looking forward to the WHATWG blessing some new specs; Web Applications in particular will be huge if it can get a base of implementations.


You cooin’ with my bird?

Offline

#12 2005-11-15 06:30:34

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Can I use Textpattern to... output HTML 4.01 code?

And if we go down the <code>application/xhtml+xml</code> route does this mean that we really don’t want visitors being able to use mark-up in comments??


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB