Working with XHTML Creating a Well-Formed Valid Document.

Slides:



Advertisements
Similar presentations
CSCI N241: Fundamentals of Web Design Copyright ©2004 Department of Computer & Information Science Introducing XHTML: Module B: HTML to XHTML.
Advertisements

EXtensible HyperText Markup Language Miruna Bădescu Finsiel Romania Copenhagen, 25 May 2004.
XHTML Week Two Web Design. 2 What is XHTML? XHTML is the current standard for HTML Newest generation of HTML (post-HTML 4) but has many new features which.
Dr. Alexandra I. Cristea XHTML.
HTML/XML XHTML Authoring. Creating Tables  Table: An arrangement of horizontal rows and vertical columns. The intersection of a row and a column is called.
 Fundamentals of Web Design.  Describe the history and theory of XHTML  Understand the rules for creating valid XHTML documents  Apply a DTD to an.
Pengantar Teknologi Mobile 13 Antonius Rachmat C, S.Kom, M.Cs XHTML.
History Leading to XHTML
Tutorial 9 Working with XHTML
XHTML 16-Apr-17.
XHTML1 Building Document Structure. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML) documents.
17-Jun-15 XHTML 2 What is XHTML? XHTML stands for Extensible Hypertext Markup Language XHTML is aimed to replace HTML.
Unit 2, cont. September 14 HTML,Validating your pages, Publishing your site.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
1 HTML’s Transition to XHTML. 2 XHTML is the next evolution of HTML Extensible HTML eXtensible based on XML (extensible markup language) XML like HTML.
Developing a Basic Web Page with HTML
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
© Ms. Masihi 1.  A web page is created using a language called, Hypertext Markup Language, better known as HTML Code.  HTML is a user friendly language.
Computer Sciences Department
XP Tutorial 9New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
XP The University of Akron Summit College Business Technology Department Computer Information Systems 2440: 140 Internet Tools Instructor: Enoch E. Damson.
HTML BASICS Creating Web Pages with HTML CIS 133 Web Programming Concepts 1.
 XHTML is aimed to replace HTML  XHTML is almost identical to HTML 4.01  XHTML is a stricter and cleaner version of HTML  XHTML is HTML defined as.
2440: 211 Interactive Web Programming Introduction to the Internet & the World Wide Web.
Chapter 1 Understanding the Web Design Environment Principles of Web Design, 4 th Edition.
Week 1 Understanding the Web Design Environment. 1-2 HTML: Then and Now HTML is an application of the Standard Generalized Markup Language Intended to.
Chapter 1 XHTML: Part I The Web Warrior Guide to Web Design Technologies.
XHTML1 Building Document Structure Chapter 2. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML)
XHTML Presented by Kelly(Geun-young) Yim. Learning Objectives  List the difference between XHTML and HTML  Create a valid, well-formed XHTML document.
XHTML Presentation by Kevin See June 16, XML in HTML Meeting Report  May 11, 1998  html
Introduction. Document Structure Overview  XML declaration (prolog)  Document type declaration  Root element (namespace)  Document header  Document.
3 XHTML.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
1 HTML XHTML. 2 Understand the Doctype tag Know the html tags which are now classed as depreciated Understand how Dreamweaver adds styles Add styles to.
1 XHTML محمد احمدی نیا 2 Of 19 HTML vs XHTML  XHTML is a stricter and cleaner version of HTML.  by combining the strengths of HTML.
XHTML Web and Database Management System. HTML’s History HTML was initially defined by Tim-Berners-Lee in 1990 at CERN (European Organization for Nuclear.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorial 9: Working With XHTML.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
XP 2 HTML Tutorial 1: Developing a Basic Web Page.
Chapter 1 Understanding the Web Design Environment Principles of Web Design, 4 th Edition.
Lesson 4.
IT Engineering I Instructor: Rezvan Shiravi
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Creating XHTML Documents Essentials for.
1 Introduction to XML XML stands for Extensible Markup Language. Because it is extensible, XML has been used to create a wide variety of different markup.
Lecture: Web Design Assis. Prof. Freshta Hanif Ehsan Faculty of Computer Science Kabul Polytechnic University Spring Semester
Copyright © 2003 Pearson Education, Inc. Slide 1-1 Created by Cheryl M. Hughes The Web Wizard’s Guide to XHTML by Cheryl M. Hughes.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 2: Markup Language and Site Development Essentials © 2007 Prosoft Learning Corporation All.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
Unit 3 — Advanced Internet Technologies Lesson 10 — Introduction to XHTML.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
XP 2 HTML Tutorial 1: Developing a Basic Web Page.
XP 1 HTML Tutorial 1: Developing a Basic Web Page.
CIS 228 The Internet 9/20/11 XHTML 1.0. “Quirks” Mode Today, all browsers support standards Compliant pages are displayed similarly There are multiple.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Extensible Markup Language (XML) Pat Morin COMP 2405.
What is XHTML? XHTML stands for Extensible Hypertext Markup Language
CIS 228 The Internet 9/20/11 XHTML 1.0.
Creating a Well-Formed Valid Document
CITA 330 Section 3 XHTML.
Tutorial 9 Working with XHTML
Tutorial 9 Working with XHTML
What is XHTML?.
XHTML
Web Programming Maymester 2004
Tutorial 9 Working with XHTML
XHTML 7-May-19.
XHTML 29-May-19.
محمد احمدی نیا XHTML محمد احمدی نیا
Presentation transcript:

Working with XHTML Creating a Well-Formed Valid Document

Introducing XHTML SGML (Standard Generalized Markup Language) –can be used with almost any type of document stored in almost any format –Introduced in the 1980s –Metalanguage– used to created other languages HTML –standards get confusing among browsers – can be applied inconsistently

Introducing XHTML XML (Extensible Markup Language) –used to design markup languages XML documents must be evaluated with an XML parser An XML document with correct syntax is a well- formed document A well-formed document with correct content and structure is a valid document DTD specifies correct content and structure

Introducing XHTML XHTML is an application of HTML, written in XML

DTDs associated with XHTML transitional: supports many of the presentational features of HTML, including the deprecated elements and attributes Best used for older documents that contain deprecated features

DTDs associated with XHTML frameset: used for documents containing frames, and also supports deprecated elements and attributes

DTDs associated with XHTML strict: does not allow any presentational features or deprecated HTML elements and attributes. Does not support frames or inline frames. It is best used for documents that need to strictly conform to the latest standards.

Creating a Well-Formed Document Rules for well-formed XHTML documents

Creating a Well-Formed Document XHTML documents must also include a single root element that contains all other elements –For XHTML, that root element is the html element Attribute minimization is when some attributes lack attribute values –XHTML doesn’t allow attribute minimization

Attribute minimization in HTML and XHTML

Creating a Valid Document The DTD used depends on the content of the document and the needs of your users To support old browsers, use the transitional DTD To support old browsers in a framed Web site, use the frameset DTD To support more current browsers and want to weed out any use of deprecated features, use the strict DTD

Creating a Valid Document Elements not allowed under the strict DTD: –applet- isindex –basefont- menu –center- s –dir- strike –font- u –iframe

Creating a Valid Document Some attributes are restricted, while others are required in XHTML

Attributes prohibited in the strict DTD

Element Attribute

Required XHTML attributes

Creating an XHTML Document The first line of an XTHML document should contain a declaration indicating that the document adheres to the rules and syntax of XML XML (and thus XHTML) documents are based on a character set –A character set is a set of abstract symbols matched to code numbers

Adding an xml Declaration For XHTML documents, use the declaration:

The XML Declaration

Setting the XHTML Namespace To set XHTML as the default namespace for a document, add the xmlns attribute to the html element with the following value:

Testing an XHTML Document To test your document, you need to send the file to an XML parser or an XHTML validator Sometimes the same mistake results in several errors are noted in the report - fixing one mistake can solve several errors

Strict XHTML Document You’ll need the following DOCTYPE declaration

Tips for Converting old HTML Code to XHTML Include an xml declaration in the first line of your file so that your document can be accessed by XML parsers Add a DOCTYPE declaration for one of the XHTML DTDs and check your document for well- formedness and validity whenever you make a change to the code Add the XHTML default namespace to the html element of your document

Tips for Converting old HTML Code to XHTML Make sure that all element and attribute names are in lowercase letters and that all attribute values are placed in quotes Make sure that all empty elements are entered as one-sided tags. Look especially for improper syntax in the img, hr, and br elements Make sure that all two-sided tags are properly closed. Old HTML code often does not have closing tags for the p element

Tips for Converting old HTML Code to XHTML Make sure that all inline images contain the alt attribute Look for deprecated attributes such as align, bgcolor, and background, and replace them with the float (or text-align), background-color, and background-image styles Replace the name attribute with the id attribute Fix all instances of attribute minimization

Tips for Converting old HTML Code to XHTML Replace the use of the font element with either the span element or with a style that applies the same formatting specified by the font element Replace the use of the width attribute in the td or th element with the width style