xhtml presentation by kevin see june 16, 2000. xml in html meeting report may 11, 1998 ...

19
XHTML Presentation by Kevin See June 16, 2000

Upload: aron-stanley

Post on 12-Jan-2016

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

XHTML

Presentation by Kevin See

June 16, 2000

Page 2: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

XML in HTML Meeting Report

May 11, 1998 http://www.oasis-open.org/cover/NOTE-xh-

19980511.html How do we “hide” new idioms from

deployed software How do we introduce new idioms with

distinctive display characteristics, such as MathML?

Page 3: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

What Is XHTML?

XHTML (Extensible Hypertext Markup Language) is “a reformulation of HTML 4 as an application of the Extensible Markup Language (XML)”

XHTML is a family of current and future document types and modules that reproduce, subset, and extend HTML 4.

Page 4: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

Why Would You Want to Use XHTML?Extensibility

1. Powerful machine

2. New tags / attributes

3. Lead to more complicated pages and larger programs

Portability

1. Small devices – mobile devices and possibly household devices

2. Several levels of possible markup

3. Web pages can now be made simpler

Page 5: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

Document Conformance

Strictly conforming documents Must validate against proposed DTDs. Root element must be <html>. Root element must designate the XHTML

namespace using the xmlns attribute. (see next slides for details)

There must be a DOCTYPE declaration in the document prior to the root element.

Page 6: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

Document Conformance- Using XHTML With Other Namespaces

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>A Math Example</title> </head> <body> <p>The following is MathML markup:</p> <math xmlns="http://www.w3.org/1998/Math/MathML"> <apply> <log/> <logbase> <cn> 3 </cn> </logbase> <ci> x </ci> </apply> </math> </body> </html>

Page 7: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

Document Conformance- Using XHTML With Other Namespaces

<?xml version="1.0" encoding="UTF-8"?>

<!-- initially, the default namespace is "books" -->

<book xmlns='urn:loc.gov:books'

xmlns:isbn='urn:ISBN:0-395-36341-6' xml:lang="en" lang="en">

<title>Cheaper by the Dozen</title>

<isbn:number>1568491379</isbn:number>

<notes>

<!-- make HTML the default namespace for a hypertext commentary -->

<p xmlns='http://www.w3.org/1999/xhtml'>

This is also available <a href="http://www.w3.org/">online</a>.

</p>

</notes>

</book>

Page 8: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

User Agent Conformance

http://www.w3.org/TR/xhtml1/

1. Consistent with XML

2. Consistent with facilities definition

3. Recognize attributes of type ID

4. Unrecognized Items

5. Space, Tab, Carriage Return, Line Feed are considered as white space.

Page 9: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

DTDs – Document Type Definitions XHTML 1.0 specifies three XML document types that

correspond to the three HTML 4.0 DTDs: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> ------ XHTML 1.0 Strict

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> ------ XHTML 1.0 Transitional

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "DTD/xhtml1-frameset.dtd"> ------ XHTML 1.0 Frameset

Page 10: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

Differences With HTML 4 Document must be well-formed Tag and attribute names must be written in lower-case (see

XHTML Case Poll) For non-empty elements, end tags are required Empty elements must be terminated (e.g. <br /> ) Attribute values must always be quoted (e.g. <img …

border = “0” /> Attribute value pairs cannot be minimized (e.g. <ul

compact = “compact” > ) “name” attribute is formally deprecated (to be removed

later), use “id” attribute instead

Page 11: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

Differences With HTML 4 <script> and <style> elements are declared as having

#PCDATA content.

e.g.

<script language="JavaScript type="text/javascript">

<![CDATA[

document.write("<b>Hello World!</b>");

]]>

</script>

Page 12: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

Differences With HTML 4 – SGML Exclusionsa

cannot contain other a elements. pre

cannot contain the img, object, big, small, sub, or sup elements.

button cannot contain the input, select, textarea, label, button, form, fieldset, iframe or isindex elements.

label cannot contain other label elements.

form cannot contain other form elements.

Page 13: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

Compatibility Issues With Existing User Agent Although there is no requirement for

XHTML 1.0 documents to be compatible with existing user agents, in practice this is easy to accomplish.

Appendix C summarizes design guidelines for authors who wish their XHTML documents to render on existing HTML user agents. http://www.w3.org/TR/xhtml1/

Page 14: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

XHTML Document StructureAn XHTML document consists of three main parts: The DOCTYPE, The Head, and The BodyHere is a minimal XHTML document1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0

Transitional//EN“ "DTD/xhtml1-transitional.dtd">2: <html xmlns="http://www.w3.org/1999/xhtml">3: <head>4: <title>Minimal document</title>5: </head>6: <body>7: <p>8: <a href="http://validator.w3.org/check/referer"> validate</a>9: </p>10:</body>11:</html>

Page 15: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

Future Directions

Modularizing XHTML (hand held device) – The process of modularization breaks up XHTML up into a series of smaller element sets. These elements can then be recombined to meet the needs of different communities.

Page 16: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

Future Directions

Document Profiles A document profile specifies the syntax and

semantics of a set of documents. Conformance to a document profile

provides a basis for interoperability guarantees.

The document profile specifies the facilities required to process documents of that type.

Page 17: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

Conclusion Example of site written in XHTML - Brian White

& Associates XHTML 1.0 Combines the Familiarity of HTML

with the Power of XML XHTML 1.0 Provides a Foundation for

Device-Independent Web Access XHTML 1.0 allows authors to create Web

documents that work with current HTML browsers and that may be processed by XML- enabled software as well.

With XHTML, we are well-prepared to move into the 21st century web.

Page 18: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

Interesting URLs

HTML conversion tool – Tidy HTML Writers Guild – world largest intern

ational organization of web authors (over 110,000 members, over 150 countries)

W3C HTML validation Service HTML Validator – Commercial Product FOP – formatter that produces PDF from

XSL formatting objects

Page 19: XHTML Presentation by Kevin See June 16, 2000. XML in HTML Meeting Report  May 11, 1998   19980511.html

Interesting URLs

W3C's Amaya Browser - The latest release includes the support of HTML 4.0 and XHTML

Slide set on XHTML -This is a recent slide set for XHTML first presented at the W3LA event in Stockholm on 24th March 1999.