1 / 14

Understanding XHTML Document Types and Language Encoding

This document provides an in-depth overview of XHTML document types, including XHTML 1.0 Strict, Transitional, Frameset, and XHTML 1.1. It outlines the requirements for declaring document types (DOCTYPE) and character encoding, emphasizing the importance of ensuring consistency across different document formats. The potential use of XHTML 2.0 is also discussed, highlighting its role in enhancing web document presentation. Language settings for both English and Thai are covered, focusing on different character encodings such as ISO and UTF-8.

luigi
Download Presentation

Understanding XHTML Document Types and Language Encoding

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. XHTMLDOCTYPE, Language & Structure โดยสว่าง ศรีสม องค์การคนพิการสากลประจำภูมิภาคเอเชีย-แปซิฟิก

  2. DOCTYPE (ประเภทเอกสาร) ต้องมี DOCTYPE เพื่อประกาศประเภทเอกสารทุกครั้งก่อน Root Eliment DOCTYPE มี 3 ประเภท (XHTML 1.0) ดังนี้ • <!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"> (แบบใช้เฟรม)

  3. DOCTYPE (ประเภทเอกสาร) XHTML 1.1 ใช้ระบบโมดูลและเป็นฐานสำหรับการพัฒนา XHTML ในอนาคตเพื่อให้มีความสม่ำเสมอและแยกขาดจากการตกแต่งอย่างเด็ดขาด <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> XHTML 2.0 (ร่าง) เป็นภาษามาร์กอัพออกแบบมาเพื่อนำเสนอเอกสารเพื่อใช้ในวัตถุประสงค์ที่แตกต่างกัน <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml2.dtd">

  4. รหัสอักขระและภาษา (Character Encoding & Language) • ภาษาอังกฤษ • รหัสอักขระ:iso-8859-1 และ windows-1252 • รหัสภาษา:en • ภาษาไทย • รหัสอักขระ: iso-8859-11, tis-620, windows-874 • รหัสภาษา:th • ทางเลือกใหม่ UTF-8 ทำงานกับหลายภาษา

  5. การนำไปใช้ (XHTML 1.0 Strict) <?xml version="1.0" encoding="tis-620"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="th"> <head> <meta http-equiv="Content-Type" content="text/html; charset=tis-620" /> <meta http-equiv="Content-Style-Type" content="text/css; charset=tis-620" /> <title>Example Page</title> </head> <body> … </body> </html>

  6. การนำไปใช้ (XHTML 1.0 Transitional) <?xml version="1.0" encoding=“utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="th"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css; charset=utf-8" /> <title>Example Page </title> </head> <body> … </body> </html>

  7. การนำไปใช้ (XHTML 1.0 Frameset) <?xml version="1.0" encoding="tis-620"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="th"> <head> <meta http-equiv="Content-Type" content="text/html; charset=tis-620" /> <meta http-equiv="Content-Style-Type" content="text/css; charset=tis-620" /> <title>Example Page </title> </head> <body> … </body> </html>

  8. การนำไปใช้ (XHTML 1.1) <?xml version="1.0" encoding=“utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="th"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css; charset=utf-8" /> <title>Example Page </title> </head> <body> … </body> </html>

  9. การนำไปใช้ (XHTML 2.0) <?xml version="1.0" encoding=“utf-8"?> <?xml-stylesheet type="text/css" href="http://www.w3.org/MarkUp/style/xhtml2.css"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml2.dtd"> <html xmlns="http://www.w3.org/2002/06/xhtml2/" xml:lang="en" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2002/06/xhtml2/ http://www.w3.org/MarkUp/SCHEMA/xhtml2.xsd" > <head> <title>Example Page</title> </head> <body> … </body> </html>

  10. ภาพรวมโครงสร้างเอกสาร XHTML (1.0) ส่วนที่หนึ่ง (XML) <?xml version="1.0" encoding="tis-620"?> ส่วนที่สอง (DOCTYPE) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> ส่วนที่สาม (ตัวเอกสาร) <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="th"> <head> <meta http-equiv="Content-Type" content="text/html; charset=tis-620" /> <meta http-equiv="Content-Style-Type" content="text/css; charset=tis-620" /> <title>Example Page </title> </head> <body>…</body></html>

  11. ตัวเอกสาร XHTML (1.0) ตัวเอกสาร (จุดเริ่มต้น) <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="th"> ส่วนหัว (ข้อมูลทั่วไปของเอกสาร) <head> <meta http-equiv="Content-Type" content="text/html; charset=tis-620" /> <title>Example Page </title> </head> ส่วนสำหรับใส่เนื้อหา <body> … เนื้อหา … </body> จุดสิ้นสุดตัวเอกสาร </html>

  12. โครงสร้างเนื้อหา XHTML (1.0) ส่วนสำหรับใส่เนื้อหา <body> <h1>หัวเรื่องที่หนึ่ง</h1> หัวเรื่องย่อย เช่น <h2>, <h3>, <h4>, <h5>, <h6> ย่อหน้า <p> ลิสต์ <ol>, <ul> ฯลฯ </body> </html>

  13. ตัวอย่างโครงสร้างเนื้อหา XHTML (1.0)

  14. END

More Related