1 / 12

XHTML

XHTML. Chapter 12. Extensible HyperText Markup Language. stricter syntax, based on the requirements of XML XHTML syntax looks much like HTML syntax XHTML documents can be processed automatically using any standard XML library. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

Download Presentation

XHTML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XHTML Chapter 12

  2. Extensible HyperText Markup Language. • stricter syntax, based on the requirements of XML • XHTML syntax looks much like HTML syntax • XHTML documents can be processed automatically using any standard XML library

  3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML LANG="en"> <HEAD> <TITLE>A simple HTML document</TITLE> </HEAD> <BODY> <P>Hello world! <BR> Can anybody hear me? </BODY> </HTML>

  4. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <htmlxmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>A simple XHTML document</title> </head> <body> <p>Hello world! <br /> Can anybody hear me?</p> </body> </html>

  5. Why XHTML? • Web content is delivered to more devices than conventional computers • HTML’s flexibility sometimes meant that the document structures they needed to manipulate looked a little different than expected • XHTML’sXML compatibility made it easy to use these tools on XHTML • XHTML encourages greater consistency among documents

  6. Why XHTML? • W3C was hoping that moving to an XML foundation would let developers create custom vocabularies for mixing with the classic HTML vocabulary • XHTML could also be mixed in to other XML vocabularies

  7. XHTML and XML Namespaces • XML is incredibly generic • XHTML without any other vocabularies mixed in, the namespace is declared on the html element using the XHTML attribute xmlns • <htmlxmlns="http://www.w3.org/1999/xhtml" >

  8. XHTML Versions • XHTML 1.0 has the same contents as HTML 4.01, • XHTML 1.1 is a module-based reformatted version of the 1.0 release • XHTML 2.0 Working Draft is controversial because it breaks backward compatibility with all previous versions

  9. Document Types • XHTML 1.0 Strict • XHTML 1.0 Transitional • XHTML 1.0 Frameset • XHTML 1.1 • XHTML 2.0

  10. Validation Tools • Example 12-2. Adding a validation link as validate.html

  11. Generating XHTML with PHP • Generating XHTML fromyour PHP code is no more difficult than creating plain old HTML • Example 12-4. Creating an XHTML document from PHP

More Related