XHTML vs HTML
Moderator: General Moderators
XHTML vs HTML
What's the major difference between the two, other then a stricter document? I've been searching on what XHTML does that HTML doesn't. Is it like XML where you can create your own tags, with it's own name and attributes?
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
There are others who are better equipped to answer this, but...
XHTML doesn't support custom tags, NO! If you use one you'll get a validation error.
XHTML as far as I know requires some standards in writing HTML, such as:
1) quotes around attributes
2) smaller-case tag names
3) Tags are all properly closed
There is litter difference between the two except for the enforcement of standards - which are rarely a bad thing in software development.
I suppose there is also the cultural connection. XHTML is more often associated with accessible web pages, using CSS for layout instead of TABLE, etc...
Other than standards, there is little technical advantage...
Cheers
XHTML doesn't support custom tags, NO! If you use one you'll get a validation error.
XHTML as far as I know requires some standards in writing HTML, such as:
1) quotes around attributes
2) smaller-case tag names
3) Tags are all properly closed
There is litter difference between the two except for the enforcement of standards - which are rarely a bad thing in software development.
I suppose there is also the cultural connection. XHTML is more often associated with accessible web pages, using CSS for layout instead of TABLE, etc...
Other than standards, there is little technical advantage...
Cheers
XHTML standardised documents should be parsable by xml tools, thus making xhtml an extension or application of xml.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
xhtml can be extended to validate with custom tags, but you have to build your own DTD. Not that a rendering engine would know what to do with them, mind you. It just renders as an inline element (a span, essentially).
I've used a custom DTD to extend xhtml for custom tag attributes I was using for a javascript form validation class. It wasn't actually necessary, I just felt like having valid xhtml. Would I bother doing it again? Ummmm.... meh.
I've used a custom DTD to extend xhtml for custom tag attributes I was using for a javascript form validation class. It wasn't actually necessary, I just felt like having valid xhtml. Would I bother doing it again? Ummmm.... meh.
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Good point. I never thought of that.Kieran Huggins wrote:xhtml can be extended to validate with custom tags, but you have to build your own DTD. Not that a rendering engine would know what to do with them, mind you. It just renders as an inline element (a span, essentially).
Brilliant...I had a form validation class before as well...it worked so nicely but required adding custom attributes to each form element which broke XHTML validation...I never even thought of using custom DTD...Kieran Huggins wrote: I've used a custom DTD to extend xhtml for custom tag attributes I was using for a javascript form validation class. It wasn't actually necessary, I just felt like having valid xhtml. Would I bother doing it again? Ummmm.... meh.
Thanks for the idea
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact: