Jump to content

Xhtml 1.1


Html

Recommended Posts

Whoever is, (s)he is probably not using it correctly as XHTML 1.1 specifies XHTML 1.1 documents MUST be served with XHTML MIME type, and no one is really doing that in order to support IE.

Link to comment
Share on other sites

  • 2 weeks later...
Whoever is, (s)he is probably not using it correctly as XHTML 1.1 specifies XHTML 1.1 documents MUST be served with XHTML MIME type, and no one is really doing that in order to support IE.
Could you expand on that? With an example? Please.
Link to comment
Share on other sites

Could you expand on that? With an example? Please.
When you read a file from a server, the server sends raw text to the client. It also sends the so called HTTP headers which give information about the file, such as it's size, language, encoding and others. It also sends the "type" of the file. This "type" tells the client how to process the file and it's called "MIME type".It may be "text/plain" which will just display the text the browser has downloaded, it may be "image/png" which will mean that this text, when processed in a special way will result in a PNG image. It could be "text/html" which will trigger the HTML rendering engine, finally producing the HTML page that you view. It can be "application/xml" which will result in the XML parser being invoked to check if the file is well formed and report errors, finally showing the XML tree if all is OK. The list goes on.The server however could be adjusted as to what MIME type to send. Either by you changing file extensions and/or by adjusting the server configuration itself.If HTML document is sent as "text/plain", you'll see all tags and everything. Well, not in IE, as IE doesn't respect MIME types very much. If an XHTML document is sent as "text/plain", the result is the same. If you send valid HTML document as "application/xml", you'll see an error if you're using any of the empty elements (br, img, hr, link, meta) or if you have some errors in it which are the result of the new XML rules. Do the same with a valid XHTML document, and you'll see the XML tree.Now, here's the tricker. XHTML files, when served as "text/html" are processed the same way as HTML files, even though their syntax is different, that they have a DTD and so forth. The Strict DTD switch only partially implements the XHTML rules.To get true XHTML behaviour, XHTML files must be served as "application/xhtml+xml". When a browser sees this MIME type, it invokes the XML parser for a well formdness check and validation, and on success, it begins rendering the page similar to HTML, but with all of the new rules in mind. New rules include namespaces, ability to style the document with processing instructions or perform XSLT transformation on it (again with PIs) and many more.The problem is IE doesn't understand this new MIME type. When it encounters a file that has it, it presents the user with a download box, as it does for all unknown MIME types.XHTML 1.1 requires that XHTML files are sent with this MIME types. All other changes, such as the deprecation of the "name" attribute in forms have this in mind. In XHTML served as "application/xhtml+xml", the ID attribute is the replacement, as in "text/html", specifying only ID doesn't do anything, but specifying "name" does. XHTML 1.0 doesn't require that. It can be served as either of those MIME types, which is why the "name" attribute remained in it.So, when you use XHTML 1.1, you're most likely not using it corectly in order to support IE.
Link to comment
Share on other sites

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...