Web Systems Design and Online Consumer Behavior [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Web Systems Design and Online Consumer Behavior [Electronic resources] - نسخه متنی

Dave Shea, Molly E. Holzschlag

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید







XHTML and Mime Types


The Zen Garden launched as an XHTML 1.1 document. After all, the markup passed XHTML 1.1 validation, so why not use that instead of the older XHTML 1.0 Strict?

As it turns out, there's more to XHTML than just closing tags properly. Even if you validate your XHTML, and it does turn out that it's completely valid, it's not technically XHTML unless you're serving it up with the correct MIME type.

MIME is a standard for describing information, and the only reason you need to know about it is because the correct MIME type for XHTML is application/xhtml+xml. You can use the far more common text/html, which is also the default for HTML, but only if you're using XHTML 1.0 Transitional or if your XHTML 1.0 Strict is meant to be backward-compatible. You may never serve XHTML 1.1 as text/html; it's always supposed to be served with an XML MIME type.

www.webstandards.org/learn/askw3c/sep2003l) and XML.com (www.xml.com/pub/a/2003/03/19/dive-into-xmll).

Further, once you turn on the proper MIME type, you trigger XML-parsing in your browser. XML has a rule that says if an error has occurredfor example, a missing </p> tagthe data must stop being parsed and return an error message. You won't even get partial rendering in your browser; you simply won't see your Web page (FIGURE 16). An XML document must be well formed, and that's thatthere's no room for error.


Figure 16. The result of XML that isn't well formed.

Is XHTML really worth all this? The whole point of XHTML was to reformulate HTML as an application of XML, after all. So it seems odd to some that you would bother using XHTML without serving it as genuine XML. The benefits of serving it this way are almost nonexistent, but pedantically speaking it's necessary if you're going to call it XHTML. If you choose not to worry about this, you're not alone. Many of the world's leading Web designers use XHTML and the text/html MIME type without a moment's pause. You're certainly in good company; just make sure to avoid using XHTML 1.1, and use only the 1.0 variants. You might also choose to avoid the issue completely and simply stick with HTML 4.01, which is properly served as the easier text/html and may be written according to similar rules as those for XHTML.

The lesson learned is that XHTML is simple on the surface, but once you start digging into the real implications, there's a whole tangled mess of issues awaiting you.


/ 90