Webforumz's RSS FeedRSS Webforumz RegistrationRegister Contact Webforumz StaffContact

[SOLVED] HTML or XHTML

This is a discussion on "[SOLVED] HTML or XHTML" within the Web Page Design section. This forum, and the thread "[SOLVED] HTML or XHTML are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Dec 17th, 2007, 22:42
Reputable Member
Join Date: Sep 2007
Location: Tehran - Iran
Age: 29
Posts: 433
Blog Entries: 2
Thanks: 7
Thanked 7 Times in 7 Posts
[SOLVED] HTML or XHTML

Hi guys,
I have read the article about choosing the right doctype in newsletter, what i want to know that if i don't use xhtml then what will i lose ?
Thanks...
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old Dec 17th, 2007, 23:21
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML or XHTML

Well, do you mean Strict vs. Transitional or do you mean HTML vs XHTML?
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Dec 18th, 2007, 00:35
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML or XHTML

Quote:
Originally Posted by marSoul View Post
if i don't use xhtml then what will i lose ?
Nothing.

...except an "X".
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Dec 18th, 2007, 00:45
Aso's Avatar
Aso Aso is offline
Moderator
Join Date: Oct 2007
Location: UK
Posts: 1,536
Blog Entries: 2
Thanks: 19
Thanked 81 Times in 76 Posts
Re: HTML or XHTML

Oooh I hear a big debate about tag soup coming along...no?

Generally, if you're not using any of the XML features with XHTML, HTML 4.01 Strict is perfectly suitable.
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Dec 18th, 2007, 00:51
alexgeek's Avatar
Moderator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,814
Blog Entries: 9
Thanks: 2
Thanked 3 Times in 3 Posts
Re: HTML or XHTML

Quote:
Originally Posted by MikeHopley View Post
Nothing.

...except an "X".
and neater code - the brawl begins
__________________
Web Design and Development Blog

Alex Perry
Technical Administrator.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Dec 18th, 2007, 04:24
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML or XHTML

Well in my opinion, the code is as neat as the autor writes it.... You can have a compliant XHTML document that is bloated with unnecessary code and a HTML document that has been written without a single element in excess.

I always use XHTML due to the fact that it is a XML version of HTML. All of the HTML elements are still available but can also be parsed as XML due to the uniform structure required by such documents. I write applications with PHP and having all documents coded in XHTML allows me to use PHP's XML parsing functions to read it, parse it and manipulate it like any other XML document. As ASO says, if you don't plan to use the XML features there aren't any killer features to make one standard recommendation better than another.

XHTML has addition benefits when it comes to accessibility and devices that don't use a standard web-browser interface. A correctly written XHTML document can easily be used to generate output on text-brailes devices and any program that can parse XML. Having said that though, HTML will also do the same. The difference is that XHTML by its recommendation requires a strict, properly formed layout whereas HTML is not quite as firm in this enforcement. Any compliant XHTML document will can be translated but this isn't the same for HTML.

If you use HTML and find yourself slipping into lazy or messy practices, switching to XHTML is a good way of forcing yourself into correctly structured documents as your code won't validate any other way...

Hope that helps a little.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)

Last edited by Rakuli; Dec 18th, 2007 at 13:13. Reason: spelling error :o
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Dec 18th, 2007, 08:17
Reputable Member
Join Date: Sep 2007
Location: Tehran - Iran
Age: 29
Posts: 433
Blog Entries: 2
Thanks: 7
Thanked 7 Times in 7 Posts
Re: HTML or XHTML

Thnx guys,
So what i understand now is that if i dont need xml then i should use html strict 4.01, right ?
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Dec 18th, 2007, 08:25
alexgeek's Avatar
Moderator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,814
Blog Entries: 9
Thanks: 2
Thanked 3 Times in 3 Posts
Re: HTML or XHTML

No it's nothing to do with XML besides the rules that (almost) ever element must be closed.
It doesn't matter whether you use XHTML or HTML just use a strict doctype
__________________
Web Design and Development Blog

Alex Perry
Technical Administrator.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Dec 18th, 2007, 08:59
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML or XHTML

Quote:
I write applications with PHP and having all documents coded in XHTML allows me to use PHP's XML parsing functions to read it, parse it and manipulate it like any other XML document.
Now that's a good reason for using XHTML.

As Alex said, the really important decision is to use a Strict doctype. And as Rakuli said, the quality of your code is unconnected to whether you use XHTML.

XHTML has certain pitfalls, which I listed in the article (the need for content negotiation, problems with google ads, and the "invalid user comment breaks entire page" issue).

All of these problems can be overcome. I don't find it to be worth the effort, given I have no use for XHTML over HTML. But if you are aware of the issues, there's nothing wrong with using XHTML.

Assuming, of course, that you're serving it with the correct MIME type -- otherwise it becomes invalid HTML, which seems a little stupid, no?

Last edited by MikeHopley; Dec 18th, 2007 at 09:18.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Dec 18th, 2007, 09:35
Reputable Member
Join Date: Sep 2007
Location: Tehran - Iran
Age: 29
Posts: 433
Blog Entries: 2
Thanks: 7
Thanked 7 Times in 7 Posts
Re: HTML or XHTML

Ok, How you guys choose your doctypes ? i mean what factors are important for you to choose html or xhtml ?
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Dec 18th, 2007, 09:43
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: HTML or XHTML

Quote:
Originally Posted by marSoul View Post
Ok, How you guys choose your doctypes ? i mean what factors are important for you to choose html or xhtml ?
I've never found a use for XHTML, so I always use HTML 4.01 Strict. Easy decision.

My approach:
  1. Does this project make use of XML, or modules such as MathML?
  2. If yes, use XHTML.
  3. If no, use HTML.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Dec 18th, 2007, 10:26
Reputable Member
Join Date: Sep 2007
Location: Tehran - Iran
Age: 29
Posts: 433
Blog Entries: 2
Thanks: 7
Thanked 7 Times in 7 Posts
Re: HTML or XHTML

Thanks Mike,
Now i think i got it !
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Dec 23rd, 2007, 00:19
Ed's Avatar
Ed Ed is offline
Moderator
Join Date: Jul 2007
Location: Cork, Ireland
Posts: 749
Blog Entries: 1
Thanks: 0
Thanked 1 Time in 1 Post
Re: HTML or XHTML

Quote:
Originally Posted by MikeHopley View Post
I've never found a use for XHTML, so I always use HTML 4.01 Strict. Easy decision.

My approach:
  1. Does this project make use of XML, or modules such as MathML?
  2. If yes, use XHTML.
  3. If no, use HTML.
Why not learn XHTML and don't bother choosing?

I was all for HTML 4.01 - but - there's no winning. I have not met somebody who has not wanted XHTML in their site. People refer to it (HTML) as "old technology" - it's not, I know, but times do change and it's just like with everything.

I can easily spot that XHTML is the way everything is going, so rather sooner than later.

Thanks,
Ed
Last Blog Entry: Happy New Year! (Jan 1st, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote