Module 2 (III): XHTML

Similar documents
XHTML. XHTML stands for EXtensible HyperText Markup Language. XHTML is the next generation of HTML. XHTML is almost identical to HTML 4.

XHTML & CSS CASCADING STYLE SHEETS

What is XHTML? XHTML is the language used to create and organize a web page:

HTML Overview. With an emphasis on XHTML

Web Development & Design Foundations with XHTML. Chapter 2 Key Concepts

HTML. Mohammed Alhessi M.Sc. Geomatics Engineering. Internet GIS Technologies كلية اآلداب - قسم الجغرافيا نظم المعلومات الجغرافية

Motivation (WWW) Markup Languages (defined). 7/15/2012. CISC1600-SummerII2012-Raphael-lec2 1. Agenda

Chapter 2:- Introduction to XHTML. Compiled By:- Sanjay Patel Assistant Professor, SVBIT.

Module 2 (VI): CSS [Part 3]

Session 23 XML. XML Reading and Reference. Reading. Reference: Session 23 XML. Robert Kelly, 2018

Structured documents

Chapter 10: Understanding the Standards

HTML HTML/XHTML HTML / XHTML HTML HTML: XHTML: (extensible HTML) Loose syntax Few syntactic rules: not enforced by HTML processors.

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

Announcements. Paper due this Wednesday

CSI 3140 WWW Structures, Techniques and Standards. Markup Languages: XHTML 1.0

Understanding the Web Design Environment. Principles of Web Design, Third Edition

Extensible Markup Language (XML) Hamid Zarrabi-Zadeh Web Programming Fall 2013

XHTML CHAPTER 16. Chapter 16

Creating A Web Page. Computer Concepts I and II. Sue Norris

Module 2 (VII): CSS [Part 4]

introduction to XHTML

Scripting for Multimedia LECTURE 1: INTRODUCING HTML5

Web Design and Development ACS Chapter 3. Document Setup

INTRODUCTION TO WEB USING HTML What is HTML?

CMT111-01/M1: HTML & Dreamweaver. Creating an HTML Document

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2018)

HTML & XHTML Tag Quick Reference

Introduction to HTML5

Anatomy of an HTML document

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017)

How the Internet Works

Advanced HTML Scripting WebGUI Users Conference

HTML: The Basics & Block Elements

FUNDAMENTALS OF WEB DESIGN (46)

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

CS144 Notes: Web Standards

CSC309 Tutorial CSS & XHTML

XHTML 1.0: The Extensible HyperText Markup

A network is a group of two or more computers that are connected to share resources and information.

History of the Internet. The Internet - A Huge Virtual Network. Global Information Infrastructure. Client Server Network Connectivity

(1) I (2) S (3) P allow subscribers to connect to the (4) often provide basic services such as (5) (6)

Programmazione Web a.a. 2017/2018 HTML5

HTML Overview formerly a Quick Review


Web Publishing Basics I

HTML is a mark-up language, in that it specifies the roles the different parts of the document are to play.

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

c122jan2714.notebook January 27, 2014

Bridges To Computing

Lecture 2: Tools & Concepts

Tutorial 1 Getting Started with HTML5. HTML, CSS, and Dynamic HTML 5 TH EDITION

Markup Languages SGML, HTML, XML, XHTML. CS 431 February 13, 2006 Carl Lagoze Cornell University

Web Development IB PRECISION EXAMS

1. The basic building block of an HTML document is called a(n) a. tag. b. element. c. attribute. d. container. Answer: b Page 5

Duke Library Website Preliminary Accessibility Assessment

HyperText Markup Language (HTML)

bur,:{ f 2

Appendix A. XHTML 1.1 Module Reference

HTML. Hypertext Markup Language. Code used to create web pages

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

Fundamentals: Client/Server

(from Chapter 5 & 25.6 of the text)

Implementing a chat button on TECHNICAL PAPER

COMSC-030 Web Site Development- Part 1. Part-Time Instructor: Joenil Mistal

What is a web site? Web editors Introduction to HTML (Hyper Text Markup Language)

Introduction to Web Development

INTERNET PROGRAMMING XML

MP3 (W7,8,&9): HTML Validation (Debugging) Instruction

Internet publishing HTML (XHTML) language. Petr Zámostný room: A-72a phone.:

Advanced Web Programming C2. Basic Web Technologies

CMPT 165 Unit 2 Markup Part 2

XML: Introduction. !important Declaration... 9:11 #FIXED... 7:5 #IMPLIED... 7:5 #REQUIRED... Directive... 9:11

1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document.

HTML CS 4640 Programming Languages for Web Applications

CIS 228 (Fall 2011) Exam 1, 9/27/11

CS134 Web Site Design & Development. Quiz1

Introduction to HTML EVALUATION COPY. (HTM101 version 3.1.5) Copyright Information. Copyright 2013 Webucator. All rights reserved.

HTML TAG SUMMARY HTML REFERENCE 18 TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES MOST TAGS

Modify cmp.htm, contactme.htm and create scheduleme.htm

Outline. XML vs. HTML and Well Formed vs. Valid. XML Overview. CSC309 Tutorial --XML 4. Edward Xia

Module 2-1-1: Markup Languages & HTML

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Wireframe :: tistory wireframe tistory.

Implementing Web Content

HTML. Based mostly on

but XML goes far beyond HTML: it describes data

Html basics Course Outline

Computer Science E-75 Building Dynamic Websites

Author: Irena Holubová Lecturer: Martin Svoboda

Basic Web Pages with XHTML (and a bit of CSS) CSE 190 M (Web Programming), Spring 2008 University of Washington Reading: Chapter 1, sections

XML/XHTML ESA 2008/2009. Eelco Schatborn 11 september 2008

Review of HTML. Chapter Pearson. Fundamentals of Web Development. Randy Connolly and Ricardo Hoar

What is XML? XML is designed to transport and store data.

Navigation. Websites need a formalized system of links to allow users to navigate the site

DIPLOMA IN WEB DESIGNING

IMY 110 Theme 11 HTML Frames

Comm 244 Week 3. Navigation. Navigation. Websites need a formalized system of links to allow users to navigate the site

HTML TUTORIAL ONE. Understanding What XHTML is Not

Unit 5 Web Publishing Systems Page 1 of 13 Part 4 HTML Part 4

Transcription:

INTERNET & WEB APPLICATION DEVELOPMENT SWE 444 Fall Semester 2008-2009 (081) Module 2 (III): XHTML Dr. El-Sayed El-Alfy Computer Science Department King Fahd University of Petroleum and Minerals alfy@kfupm.edu.sa Objectives/Outline Objectives Learn what and why is XHTML Learn the differences between HTML and XHTML Learn how to create XHTML documents Outline Introduction Why XHTML? Differences from HTML Anatomy of XHTML document XHTML DTDs XHTML Validation 2.2 1

Introduction XHTML stands for extensible HyperText Markup Language XHTML is aimed to replace HTML XHTML is almost identical to HTML 4.01 but a stricter and cleaner version XHTML is a reformulation of HTML into a language that conforms to the XML 1.0 Recommendation XHTML is a bridge between HTML and XML XHTML Family document types are all XML-based, and ultimately are designed to work in conjunction with XML-based user agents 2.3 Introduction (cont.) XHTML 1.0 separation of document structure from presentation issues concerning accessibility and internationalization the three DTD offerings (strict, transitional, and frameset) XHTML 1.1 (modular XHTML) Small devices (like mobile devices) cannot support all XHTML 1.0 functions. XHTML 1.1 divides the specification into modules with limited functionality. Small browsers can reduce their complexity by supporting only selected modules (but once a module has been chosen, all of its features must be supported). XHTML 1.1 is a strict language g and is not backward compatible with HTML 4. XHTML 2.0 A next generation markup language. The functionality is expected to remain similar to XHTML 1.1, but not intended to be backward compatible with HTML 4, XHTML 1.0 and XHTML 1.1 2.4 2

Why XHTML? Many pages on the WWW contain "bad" HTML e.g. not well-formed documents Need to separate document structure and document formatting (styling) XHTML phases out (deprecate) formatting information from HTML and makes place for CSS Conformance with XML syntax XHTML pages can be read by all XML enabled devices XHTML is a combination of HTML and XML Like XML, everything has to be marked up correctly, which results in "well-formed" documents XHTML consists of all the elements in HTML 4.01 combined with the syntax of XML 2.5 Differences from HTML The most important differences are: All tag and attribute names must be in lowercase All elements must be closed All elements must be properly nested All documents must be well-formed All values of attributes must be quoted, e.g. width= 50 Attribute minimization is forbidden The id attribute replaces the name attribute All documents must have DTD declaration The XHTML DTD defines mandatory elements 2.6 3

Lowercase because XHTML documents are XML applications XML is case-sensitive Tags like <br> and <BR> are interpreted as different tags 2.7 Elements Must Be closed Non-empty elements must have an end tag, e.g. <li>a list item </li> Empty elements must also be closed by having an end tag or by ending the start tag with />, e.g. <img src= flower.jpeg /> Line break <br /> Horizontal rule <hr /> * Note that some browsers require a space before the / 2.8 4

Properly Nested In HTML some elements can be improperly nested within each other, e.g. <b><i>this text is bold and italic</b></i> In XHTML all elements must be properly nested within each other, e.g. <b><i>this text is bold and italic</i></b> A common mistake in nested lists, is to forget that the inside list must be within an li element 2.9 Well-Formed Documents All XHTML elements must be nested within the <html> root element All other elements can have sub-elements (children). Sub-elements must be in pairs and correctly nested within their parent element. The basic document structure is <html> <head>... </head> <body>... </body> </html> 2.10 5

Attribute Minimization is Forbidden HTML compact checked declare readonly disabled selected defer ismap nohref noshade nowrap multiple noresize XHTML compact="compact" checked="checked" declare="declare" readonly="readonly" disabled="disabled" selected="selected" defer="defer" ismap="ismap" nohref="nohref" noshade="noshade" nowrap="nowrap" multiple="multiple" noresize="noresize" Examples <frame noresize> not allowed <frame noresize= noresize > correct <input type= radio name= stuff CHECKED> not allowed <input type= radio name= stuff checked= checked /> correct 2.11 The id replaces the name attribute HTML 4.01 defines a name attribute for the elements a, applet, frame, iframe, img, and map In XHTML the name attribute is deprecated and replaced with the id attribute <img src="picture.gif" id="picture1" /> Both name and id attributes are designed to be used as fragment identifiers there can only be a single attribute of type id per element. 2.12 6

Mandatory XHTML Elements An XHTML document may have an optional (but recommended) xml declaration, which has three attributes: <?xml version="1.0" encoding="utf-8 standalone= yes?> The version attribute is required The encoding attribute specifies the character encoding the document uses. The Unicode Transformation Format (UTF) is the default in XML The standalone attribute says whether a document uses an external DTD (a grammar for a class of documents) An XHTML document must have three main parts: A DOCTYPE declaration A head A body 2.13 XHTML Document Template <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" a "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>... </title> </head> <body>... </body> </html> 2.14 7

XHTML DTD The DOCTYPE declaration is used to indicate the DTD that is used by an XHTML document Gives a reference to one of the publicly available DTDs on the web An XHTML DTD describes in precise the allowed syntax and grammar of XHTML markup. There are currently 3 XHTML 1.0 document types: STRICT TRANSITIONAL FRAMESET These document types are distinguished in part by the degree to which they accept or do not accept deprecated HTML elements 2.15 XHTML DTD (cont.) XHTML 1.0 Strict Use this when you want really clean markup, free of presentational clutter. Use this together with Cascading Style Sheets. XHTML 1.0 Transitional i Use this when you need to take advantage of HTML's presentational features and when you want to support browsers that don't understand Cascading Style Sheets. XHTML 1.0 Frameset Use this when you want to use HTML Frames to partition the browser window into two or more frames. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> 2.16 8

XHTML Validation An XHTML document is validated against a Document Type Definition (DTD) W3C Validation Tool http://validator.w3.org/ an HTML form for checking (but not fixing) HTML and XHTML documents Dave Raggett's HTML TIDY http://www.w3.org/people/raggett/tidy/ a free UNIX tool for checking and cleaning up HTML pages XHTML Tag List http://www.w3schools.com/xhtml/xhtml_reference.asp XHTML Attributes http://www.w3schools.com/xhtml/xhtml_standardattributes.asp 2.17 Q & A? 1.18 9

References Some useful links with examples and other resources: W3C at http://www.w3.org/xhtml/ W3Schools at http://www.w3schools.com/ http://www.w3schools.com/xhtml/ http://en.wikipedia.org/wiki/list_of_document_markup_languages Internet and World Wide Web How to Program, 4/e, H. M. Deitel, P. J. Deitel, and A. B. Goldberg, Pearson Education Inc., 2008. Chapter 4. Web Development and Design Foundations with XHTML, 4/e, Pearson Education Inc. 2009. Chapter 2. 2.19 10