Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 CIS 228 The Internet 9/20/11 XHTML 1.0

2 “Quirks” Mode Today, all browsers support standards Compliant pages are displayed similarly There are multiple standards HTML 4, HTML 4.01, XHTML 1.0, XHTML 1.1, … Browsers need to know which standard a page adheres to Browsers still need to support old web pages Each browser does this differently (and slowly) To avoid “quirks” mode DOCTYPE announces the standard your page uses Make sure your page obeys that standard.

3 DOCTYPE On the top line of your html file Only a handfull to choose from Spelling (including capitalization) must be identical HTML 4.01 (transitional) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> HTML 4.01 (strict) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> XHTML 1.0 (strict) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

4 HTML 4.01 Compliance Issues Images need an alt attribute Specify a character encoding Don't leave off end (or start) tag html element required Containing head and body elements (and nothing else) title element required in head element Only block elements nest directly in body or blockquote Block elements cannot be in p or inline elements a elements cannot contain other a elements List elements (ol and ul) only contain list items (li)

5 XML Timeline 1960's – GML 1988 – SGML standard 1991 – HTML 1994 – World Wide Web Consortium (W3C) 1996 – XML work begins 1998 – XML 1.0 W3C recommendation 1999 – XML Namespaces W3C recommendation 2001 – XML Schema W3C recommendation

6 XML Replacement for SGML (HTML-like syntax) Mechanism for specifying markup languages Sub-language documents must Be well-formed XML documents Be valid wrt a document type definition Document type definition defines the sublanguage XHTML is HTML as a XML sub-language XML parsers recognize XML documents XML applications process XML documents

7 eXtensible Markup Language Markup language (“well-formed”) Simple rules / rigidly enforced Matching start & end tags required and must nest properly Empty tags end “/>” No special characters (, &, “, ') in content Meta Markup language (“valid”) Schema (grammar) specifies document type Schema indicated by URL in DOCTYPE Different kinds of schema : DTD (Document Type Definition) XSD (XML Schema Definition)

8 XML Related Specifications XML Namespaces XML Base XML Information Set XPath XQuery XSLT XSL Formatting Objects XML Signature XML Encryption

9 XML Namespaces Disambiguated element and attribute names What do you mean by a “table”? Namespace prefix Namespace prefix definition xmlns:prefix=”URL” (the URL is just a name) Element inherit namespace definitions Default namespace definition xmlns=”URL”

10 XHTML 1.0 Strict Well-formed XML (empty elements end “ />”) XML declaration (optional) Document Type Declaration <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd Root element <html xmlns="http://www.w3.org/1999/xhtml"http://www.w3.org/1999/xhtml xml:lang="en" lang="en" >


Download ppt "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."

Similar presentations


Ads by Google