XHTML Version 1.0

The standard version of XHTML, version 1.0, is just a rewrite of HTML 4.0 in XML. You can find the W3C recommendation for XHTML 1.0 at www.w3.org/TR/xhtml1. Essentially, it's just a set of DTDs that provide validity checks for documents that are supposed to mimic HTML 4.0 (actually HTML 4.01). The W3C has created several DTDs for HTML 4.0, and the XHTML DTDs are based on those, translated into straight XML. As with HTML 4.0, XHTML 1.0 has three versions, which correspond to three DTDs here:

  • The strict XHTML 1.0 DTD The strict DTD is based on straight HTML 4.0 and does not include support for elements and attributes that the W3C considers deprecated. This is the version of XHTML 1.0 that the W3C hopes people will migrate to in time.

  • The transitional XHTML 1.0 DTD The transitional DTD is based on the transitional HTML 4 DTD. This DTD has support for the many elements and attributes that were deprecated in HTML 4.0 but are still popular, such as the <CENTER> and <FONT> elements. This DTD is also named the "loose" DTD. It is the most popular version of XHTML at the moment.

  • The frameset XHTML 1.0 DTD The frameset DTD is based on the frameset HTML 4.0 DTD. This is the DTD you should work with when you're creating pages based on frames . In that case, you replace the <BODY> element with a <FRAMESET> element. The DTD has to reflect that, so you use the frameset DTD when working with frames. That's the difference between the XHTML 1.0 transitional and frameset DTDs: The frameset DTD replaces the <BODY> element with the <FRAMESET> element.

XFrames

Speaking of frames, the W3C has recently come out with a working draft for a new specification, XFrames (see www.w3.org/TR/xframes/), which are designed to replace HTML frames.

Here are the actual <!DOCTYPE> elements you should use in XHTML for these various DTDsstrict, transitional, and framesetincluding the URIs for these DTDs:

 <!DOCTYPE html       PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html      PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> 

I'm giving the DTDs' uniform resource indicators (URIs) here, so you can copy them and cache a local copy if you want for faster access. For example, if you place the DTD files in a directory named DTD in your Web site, your <!DOCTYPE> elements might look more like this:

 <!DOCTYPE html       PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"      "DTD/xhtml1-strict.dtd"> <!DOCTYPE html      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"      "DTD/xhtml1-transitional.dtd"> <!DOCTYPE html      PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"      "DTD/xhtml1-frameset.dtd"> 

If you cache these DTDs locally, there should be less of a bottleneck when XHTML becomes very popular and users try to download your documents.



Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net