What are the advantages?

Soldato
Joined
28 Jan 2005
Posts
3,732
Location
Worcester
XHTML
  • Latest version of HTML.
  • Todays standard.
  • Stricter/cleaner and more efficient.
  • Easier and quicker to write than HTML 4.0.
  • Used in conjunction with CSS makes loading times faster.
  • More cross browser compatible than previous versions.
  • Better Search Engine Optimisation.
  • More effective and stylistic than tables.
Of course all of this will requires some skill on your part to implement.
 
Last edited:
Soldato
OP
Joined
12 Jun 2005
Posts
5,361
Lol, and Beansprout just flat squashed it in my face....well thanks :p

Well, anyways, are there any programs which will automatically create a website in XHTML so I don't have to manually code it.

Thanks
 
Soldato
Joined
18 Oct 2002
Posts
5,464
Location
London Town
Conrad11 said:
People keep telling me to make my code XHTML 1.0 Strict.

What are the advantages of this?
The advantages depend on what it's being compared to. Instead of HTML 4.01? Instead of a Transitional DTD? Or something else? XHTML is a parallel standard to HTML, and neither one can currently be called 'better' than the other in a blanket statement; it depends on application and context.

Mr_L said:
Really sorry to play Devil's advocate, but some of these points just aren't true. For "table-layouts vs CSS-layouts" or "validating vs non-validating" they're totally valid and great points, but not in a comparison of XHTML 1.0 with HTML 4.01 :). I understand where you were coming from, but the muddle of XHTML with CSS layouts and semantics is a little bugbear of mine and I haven't had anywhere else more appropriate to post about it.

It's pretentious of me to say, but there have been lots of replies over the months to threads containing table-based layouts where the replies are to "use XHTML and CSS" or just "use XHTML, it's better", without an apparent understanding of why that statement's being made. XHTML has got involved more by coincidence than by its real value as a markup language in that respect. Switching to CSS layouts does not mean you have to use XHTML; using HTML is just as good and shouldn't be frowned upon in the way that it appears to be. It's no less clean, no less semantic, no slower or less efficient and for most people is exactly what their XHTML is being interpreted as - XHTML sent as text/html is parsed by the user-agent's HTML (SGML) parser, not the XML parser. Doesn't mean it's not XHTML, just not parsed as such and so any comparisons of efficiency/speed are negated.

  • Stricter/cleaner and more efficient.
XHTML is only more strict by requirement of its design as an application of XML. HTML can be written just as strict and clean. There is a strict 4.01 DTD, but hardly anyone seems to follow it, preferring the looseness and presentational idioms of the Transitional DTD - which has given HTML its unfairly poor reputation as a markup language for the modern standards-promoting developer.

I would agree that the nature of XHTML's strictness is a great advantage, in that it promotes (by requirement) good coding habits like consistency and well-formedness.

  • Easier and quicker to write than HTML 4.0.
Debatable. Theoretically HTML should be quicker to write because of optional tags and attribute minimisation. Easier? I disagree. There's no difference, they both have the same set of elements. They only really differ syntactically, and the differences shouldn't really present any issue for anyone with the ability to use a computer.

  • Used in conjunction with CSS makes loading times faster.
Benchmarks? :D. The syntax requirements of XHTML mean that pages can potentially be larger in filesize than the equivalent HTML 4.01 page with judicious use of optional tags.

  • More cross browser compatible than previous versions.
I think that depends what angle you're coming from. There's not even support for [proper] XHTML in IE, whereas it handles HTML fine. User-agents have to do more error-correction to a 'valid' XHTML page sent as text/html against a valid HTML 4.01 (Strict) page - where there will typically be no need for error correction. The reason? You don't close "EMPTY" elements in HTML 4.01, so it has to discard all those lovely />s.

On the flip-side, XHTML 1.0 can be read by both XML user-agents and HTML/SGML user-agents, and is easier to parse, promoting wider compatibility.

  • Better Search Engine Optimisation.
I haven't yet seen any evidence to back this up. Easier to write a search-engine for (not that I can talk on that at all authoritatively), but as of now there are little benefits for SEO. Search engines have been handling HTML for a decade, and they're more than comfortable with it.

  • More effective and stylistic than tables.
Again, no difference. You can write as much crufty, table-based, bodged but valid markup in XHTML as you can in HTML.

As I say, it all depends on what you're comparing to what. Which is better: HTML 4.01 Strict or XHTML 1.0 Transitional?
 
Soldato
Joined
28 Jan 2005
Posts
3,732
Location
Worcester
Just my opinions Augmented but at least you spent the time to formulate a good solid argument and explain everything clearly unlike so many other people who just use one liners. :)
Mr_l said:
Of course all of this will requires some skill on your part to implement
I did mention that some skill is required in order to achieve all the points I made though. As I am fully aware that somebody could easily make a badly formed and coded XHTML website just as much as you could with HTML 4.01.

Although, I've always used XHTML and not HTML 4.01 so I probably shouldn't have tried to compare the two without a good knowledge of them both.

Nice explantion though Augmented, very interesting. :)
 
Soldato
Joined
12 Jan 2004
Posts
3,172
Location
Brighton
Inquisitor said:
There's really no point unless you do hand code it to be honest. The whole point in XHTML is that it is clean and semantic, which pretty much all WYSIWYG editors aren't.

I made my current design last night in photoshop, kicked it out through imageready, did a little clean up and hand-crafted a little of the other code - and mine is XHTML1.0 strict! I've also seen my website on someones phone and it looks fine!
 
Soldato
Joined
28 Jan 2005
Posts
3,732
Location
Worcester
Shoseki said:
I made my current design last night in photoshop, kicked it out through imageready, did a little clean up and hand-crafted a little of the other code - and mine is XHTML1.0 strict! I've also seen my website on someones phone and it looks fine!
Exactly, the program didn't make the code the same way a human would to the standards. Thats why you had to clean it up and add more in.
 
Soldato
Joined
12 Jan 2004
Posts
3,172
Location
Brighton
Mr_L said:
Exactly, the program didn't make the code the same way a human would to the standards. Thats why you had to clean it up and add more in.

It did 99% of the work - all the layout, cutting the images and optimising... all the work I did was the fonts and content (which I will later replace with database content).

And I use crappy photoshop 6 + imageready (old) the newed CS does all that to standards...
 
Soldato
Joined
28 Jan 2005
Posts
3,732
Location
Worcester
It probably adds in a lot of uneccessay divs that could be replaced with other tags but I havnt exported a Photshop file to XHTML so I wouldn't know.
 
Soldato
Joined
12 Apr 2004
Posts
11,788
Location
Somewhere
Shoseki said:
I made my current design last night in photoshop, kicked it out through imageready, did a little clean up and hand-crafted a little of the other code - and mine is XHTML1.0 strict! I've also seen my website on someones phone and it looks fine!
Yes, but remember, you shouldn't just be aiming to get an XHTML compliant page. Your ultimate goal should be to have a clean, semantic, cross-browser compatible page, and I'm sure the code produced by ImageReady could be improved on a lot in this respect :)

If you're going to go to the trouble of producing an XHTML compliant page, you might as well make sure it's as clean and efficient as possible. What's the point if you're just going to get to make sure it validates and then leave it at that?
 
Last edited:
Associate
Joined
23 Oct 2002
Posts
1,089
Location
London - Baka Gaijin
Augmented said:
Which is better: HTML 4.01 Strict or XHTML 1.0 Transitional?

Beansprout said:
XHTML is better because it's lowercase, which looks *so much* neater :)

I realise your's wasn't a completely serious answer, Beansprout but in fact HTML Strict would be a better choice than XHTML Transitional. XHTML Strict would be better still.

The logic for this -

1) HTML Strict will render faster as the browser doesn't need to run the various logic loops it would for a DTD-less HTML document, and has to run for a Transitional XHTML one. = Saving of a couple of milliseconds on page rendering!

2) XHTML Strict because this offers the greatest forward compatibility and you could run the document through an XSLT to convert it to another format (word processor document, RSS feed, etc, etc). = You COULD do something you probably WON'T want to do and your page will still work when browsers that don't support HTML come out (I'm guessing about 2020).

In general terms I'd recommend developing XHTML Strict with all formatting in CSS - except when it's a rush job with complex layout, when you can knock it out in tables in 5 minutes ^_^
 
Soldato
Joined
18 Oct 2002
Posts
5,464
Location
London Town
Mr_L said:
It is very good. I think Augmented is a proper Guru and should write a book! ;) :)
Hehe, thanks. But it's people like Anne van Kesteren, Ian Hickson and Faruk Ateş that are the real gurus when it comes to this sort of subject (quite a lot of talk on this very subject bounced about from postings of these guys). I'm just a mere student :).
 
Soldato
OP
Joined
12 Jun 2005
Posts
5,361
Well thanks for all the responses, and I am going to develop another webpage and try and make it XHTML Traditional.

Well I have already started and I can already see the advantages, there is quite a lot of rubbish that Frontpage makes when coding.

Thanks Again :)
 
Back
Top Bottom