What makes XHTML (and other XML languages) applications while other SGML-based languages are text? Aren’t XML files text files?
What makes XHTML (and other XML languages) applications while other SGML-based languages are text?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
XHTML is a subset of XML; XML’s media type/mime is text/xml while XHTML’s media type/mime is application/xhtml+xml.
Generally HTML is essentially treated like plain text that is interpreted very loosely. Because HTML’s junk status reputation XHTML was created to force web designers and web developers to code clean HTML. Gecko (Firefox) and Presto (Opera) browsers correctly break the page and display a malformed XML parse error whereas WebKit (Chrome/Safari) and Trident (Internet Explorer 9.0+ only) fail at failing and merely stop rendering the page.
An XHTML application served as text/html is NOT XHTML, it’s HTML with an XHTML doctype.
For XHTML code to be served as an XHTML application it must be served as application/xhtml+xml.
XHTML is also intended to be backwards compatible with HTML.
The following PHP code will look at the headers sent by the client’s browser and serve the page as an XHTML application if the browser supports it (all Chrome, Safari 3.0+ (maybe 1.0)), Mozilla Suite 0.8+/all Firefox and Opera 7.0+ (possibly 6.0) support XHTML. Only Internet Explorer 8.0 and older have any market share that does not support XHTML. KHTML browsers (Konqueror) DO support XHTML however I think 4.4 does/did not serve the correct header to the server.
XHTML is way better than HTML if you’re intelligent enough to fix errors when you come across them. It’s stricter but that’s the point, much less subjectivity. The X in XHTML stands for extensible so it supported SVG and other languages before HTML did if you do a bit of reading.