[web] On XHTML

Started by
5 comments, last by markr 18 years, 9 months ago
Hi, I was looking a couple of minutes ago the "redesign gamedev frontpage - no tables" thread, and I have to say once I looked at Etnu's and Sander's "entries" (well, seems like noone cared anymore), and I was like what the hell? I mean, they are amazing. I first thought the contest was meant to force people to use some weird "hacks", but it comes out you can achieve an amazing, good looking website with XHTML+CSS, which brings me to the start of this topic... While, I know XHTML=HTML+XML, and basically the only thing that changes is syntax (all tags must be closed, all tags in no-caps - basically a well formed and valid xml document), right. But what I want to ask is 1. Are there any freely available XHTML WYSIWYG editors? In the case not, what can I use? An XML editor that validates XML (and Id have to pass the XHTML DTD I guess), and what free tools ae at hand? Id like to know what tools did Etnu or Sander use to make their submisions... So far, Ive used Altova XML Spy to work with a cocoon project at collegue, and It was amazingly good for creating the XSLTs visually, however, my trial expired and the "Personal" version plainly sucks (looking at the comparison table in the website). A tool I recently found was Butterfly XML but unfortunately is very slow in my machine (the app is java-based)... Is dreamweaver able to WYSIWYG-edit XHTML documents? 2. What are the cross-browser issues I should be aware of? What browsers do support the latest XHTML standard (1.0 IIRC)? 3. Any other recommended tools, websites (I already read the Forum FAQ, and the sticky) Thanks for your time, cheers
Advertisement
You could always write the XHTML documents by hand [smile] That's what I do.

One of the main cross-browser issues is that XHTML pages are supposed to be served as application/xhtml+xml and NOT text/html. IE, however, does not support the application/xhtml+xml MIME so it's necessary to either server the page incorrectly (preventing the use of an XML parser on browsers that do support that MIME) or use something like PHP to ensure that pages are served correctly for browsers that support it.
I write my websites by hand. No WYSIWYG. I used HTML-Kit from chami.com to write it. Now, to your questions:

1) There are no good one's that I know of. WYSIWYG and good XHTML-CSS webdesign are hard to reconcile. It takes a lot of knowledge that's hard to capture in programming logic.

2) All browsers support XHTML 1.0 when you leave a space before the slash in a self-closing tag (i.e. <br /> instead of <br/>). Just beware not to use the XML declaration tag on top of documents (that will forec IE in quirksmode). As for the rest: Develop in a good browser like FireFox and than apply some tiny hacks to make IE obey you. Don't do it the other way around. Expect IE to hate you a lot. Check out sites like css-discuss's wiki for good information about making IE behave.

3) Aside from my HTML editor & ftp program, I rely on Paint Shop Pro to do the imaging for me. Make use of (transparent) PNG's for your site. Either don't care about IE and it's bugs with them, or apply some tiny jacascript to fix the transparency issues. Also, get a proper &#106avascript debugger.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

As an added note, make use of Firefox's DOM Inspector. It has bugs but it can help you a lot when working out weird layout mishaps. It's also helpful when you are trying to mimic another site's design.
Well, thank you guys for the replies.

Quote:Original post by Sander
I write my websites by hand. No WYSIWYG.

Thats recomforting, I thought you might have used a $$$ app

Quote:Original post by Sander
I used HTML-Kit from chami.com to write it

Do you use the personal edition? Because I wonder if the "addons" you get by buying the product are good enough to buy it (not that I have the money though).

Quote:Original post by Sander
All browsers support XHTML 1.0 when you leave a space before the slash in a self-closing tag (i.e. <br /> instead of <br/>). Just beware not to use the XML declaration tag on top of documents (that will forec IE in quirksmode). As for the rest: Develop in a good browser like FireFox and than apply some tiny hacks to make IE obey you. Don't do it the other way around. Expect IE to hate you a lot. Check out sites like css-discuss's wiki for good information about making IE behave.


"A good browser like firefox". Thats right. I use firefox 24/7. And I unistall IE with every new windows installation. However, I know 99.99% of world population still uses IE, so I guess I have to somehow test my site in IE too...
I wish you should have bookmarked that website with the PC "farm" to test a website in several browsers and get the screenie back...

Quote:Original post by Sander
get a proper &#106avascript debugger.

In the past, Ive used the Tools->&#106avascript Console. Will that &#111;ne suffice or do you have a better suggestion?<br><br><!--QUOTE--><BLOCKQUOTE><span class="smallfont">Quote:</span><table border=0 cellpadding=4 cellspacing=0 width="95%"><tr><td class=quote><!--/QUOTE--><!--STARTQUOTE--><i>Original post by Invader X</i><br>One of the main cross-browser issues is that XHTML pages are supposed to be served as application/xhtml+xml and NOT text/html. IE, however, does not support the application/xhtml+xml MIME so it's necessary to either server the page incorrectly (preventing the use of an XML parser &#111;n browsers that do support that MIME) or use something like PHP to ensure that pages are served correctly for browsers that support it.<br><!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br>Nice to know about that MIME issue<br><br><!--QUOTE--><BLOCKQUOTE><span class="smallfont">Quote:</span><table border=0 cellpadding=4 cellspacing=0 width="95%"><tr><td class=quote><!--/QUOTE--><!--STARTQUOTE--><i>Original post by Invader X</i><br>As an added note, make use of Firefox's DOM Inspector. It has bugs but it can help you a lot when working out weird layout mishaps. It's also helpful when you are trying to mimic another site's design.<br><!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br>Never heard of it before, will give it a shot.<br><br>Totally Offtopic, Invader X, your website seems to have some parsing errors<br><!--QUOTE--><BLOCKQUOTE><span class="smallfont">Quote:</span><table border=0 cellpadding=4 cellspacing=0 width="95%"><tr><td class=quote><!--/QUOTE--><!--STARTQUOTE--><br>Warning: main(cms-settings.php): failed to open stream: No such file or directory in /home/clients/invader/public_html/core-classes/db-class.php &#111;n line 17<br><br>Fatal error: main(): Failed opening required 'cms-settings.php' (include_path='.:/usr/lib/php:/usr/lib/php/php') in /home/clients/invader/public_html/core-classes/db-class.php &#111;n line 17<br><!--QUOTE--></td></tr></table></BLOCKQUOTE><!--/QUOTE--><!--ENDQUOTE--><br>No longer maintained? hehe
It's down right now. It has parsing errors because I uninstalled the CMS I was testing and just havent had a chance to upload the new version [smile].
This is somewhat unrelated, but if you serve your xhtml files as content type application/xhtml+xml, Mozilla (i.e. Firefox too) will parse them using its xml parser instead of its HTML parser (which it will use, regardless of document type declaration, if they are served as text/html)

The reason that having your xhtml documents parsed with the Mozilla XML parser, is that they will be checked for well-formedness. This means errors immediately show up.

As a side effect, &#106avascript document.write() and element.innerHTML won't work (because those could cause the document to become badly formed, and that's not allowed)

It may be useful, during development, to set the content type like this to check for well-formedness.

But don't do it in production.

Other web browsers (IE, opera, etc) don't recognise this content type, and won't display the file at all.

Mozilla has two parsers, HTML and XML - which are distinctly different, because the HTML one allows badly formed XML documents. The HTML parser has two modes (at least), standards compliance and "quirks".

If you are making a new web site, ensure that it works in standards-compliance mode (you can do this by specifying either the XHTML namespace, or a HTML 4 declaration I think)

Mark

This topic is closed to new replies.

Advertisement