SlideShare a Scribd company logo
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 1
Chapter 02
Markup Languages:
XHTML 1.0
IT2353
WEB TECHNOLOGY
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 2
HTML “Hello World!”
Document
Type
Declaration
Document
Instance
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 3
HTML “Hello World”
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 4
HTML Tags and Elements

Any string of the form < … > is a tag

All tags in document instance of Hello World are either
end tags (begin with </) or start tags (all others)
 Tags are an example of markup, that is, text treated specially
by the browser
 Non-markup text is called character data and is normally
displayed by the browser

String at beginning of start/end tag is an element name

Everything from start tag to matching end tag,
including tags, is an element
 Content of element excludes its start and end tags
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 5
HTML Element Tree
Root
Element
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 6
HTML Root Element

Document type declaration specifies name of
root element:
<!DOCTYPE html

Root of HTML document must be html

XHTML 1.0 (standard we will follow) requires
that this element contain the xml namespace
xmlns attribute specification (name/value
pair)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 7
HTML head and body Elements

The body element contains information
displayed in the browser client area

The head element contains information
used for other purposes by the browser:
 title (shown in title bar of browser window)
 scripts (client-side programs)
 style (display) information
 etc.
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 8
HTML History

1990: HTML invented by Tim Berners-Lee

1993: Mosaic browser adds support for
images, sound, video to HTML

1994-~1997: “Browser wars” between
Netscape and Microsoft, HTML defined
operationally by browser support

~1997-present: Increasingly, World-Wide
Web Consortium (W3C) recommendations
define HTML
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 9
HTML Versions

HTML 4.01 (Dec 1999) syntax defined using
Standard Generalized Markup Language (SGML)

XHTML 1.0 (Jan 2000) syntax defined using
Extensible Markup Language (XML)

Primary differences:
 HTML allows some tag omissions (e.g., end tags)
 XHTML element and attribute names are lower case
(HTML names are case-insensitive)
 XHTML requires that attribute values be quoted
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 10
SGML and XML
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 11
HTML “Flavors”

For HTML 4.01 and XHTML 1.0, the
document type declaration can be used to
select one of three “flavors”:
 Strict: W3C ideal
 Transitional: Includes deprecated elements and
attributes (W3C recommends use of style sheets
instead)
 Frameset: Supports frames (subwindows within
the client area)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 12
HTML Frameset
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 13
HTML Document Type
Declarations

XHTML 1.0 Strict:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

XHTML 1.0 Frameset:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN“
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

HTML 4.01 Transitional:
<!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN“
"http://www.w3.org/TR/html4/loose.dtd">
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 14
XHTML White Space

Four white space characters: carriage
return, line feed, space, horizontal tab

Normally, character data is normalized:
 All white space is converted to space characters
 Leading and trailing spaces are trimmed
 Multiple consecutive space characters are
replaced by a single space character
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 15
XHTML White Space
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 16
XHTML White Space
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 17
Unrecognized HTML Elements
Misspelled
element name
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 18
Unrecognized HTML Elements
title character
data
Belongs
here
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 19
Unrecognized HTML Elements
title character
data
Displayed
here
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 20
Unrecognized HTML Elements

Browsers ignore tags with unrecognized
element names, attribute specifications with
unrecognized attribute names
 Allows evolution of HTML while older browsers
are still in use

Implication: an HTML document may have
errors even if it displays properly

Should use an HTML validator to check
syntax
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 21
Unrecognized HTML Elements
Example for non-frame browsers (old)
<HTML>
<HEAD>
<TITLE>A simple frameset document</TITLE>
</HEAD>
<FRAMESET cols="20%, 80%">
<FRAME src="contents_of_frame1.html“ />
<FRAME src="contents_of_frame2.html“ />
<NOFRAMES>
<P>This doc contains frames</P>
</NOFRAMES>
</FRAMESET>
</HTML>
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 22
HTML References

Since < marks the beginning of a tag, how do
you include a < in an HTML document?

Use markup known as a reference

Two types:
 Character reference specifies a character by its
Unicode code point

For <, use &#60; or &#x3C; or &#x3c;
 Entity reference specifies a character by an HTML-
defined name

For <, use &lt;
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 23
HTML References
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 24
HTML References

Since < and & begin markup, within
character data or attribute values these
characters must always be represented by
references (normally &lt; and &amp;)

Good idea to represent > using reference
(normally &gt;)
 Provides consistency with treatment of <
 Avoids accidental use of the reserved string ]]>
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 25
HTML References

Non-breaking space ( &nbsp; ) produces
space but counts as part of a word
 Ex: keep&nbsp;together keep&nbsp;together …
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 26
HTML References

Non-breaking space often used to create
multiple spaces (not removed by
normalization)
&nbsp; + space
displays as two
spaces
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 27
XHTML Attribute Specifications

Example:

Syntax:
 Valid attribute names specified by HTML
recommendation (or XML, as in xml:lang)
 Attribute values must be quoted (matching single
or double quotes)
 Multiple attribute specifications are space-
separated, order-independent
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 28
XHTML Attribute Values

Can contain embedded quotes or references
to quotes

May be normalized by browser
 Best to normalize attribute values yourself for
optimal browser compatibility
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 29
Common HTML Elements
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 30
Common HTML Elements

Headings are produced using h1, h2, …, h6
elements:

Should use h1 for highest level, h2 for next
highest, etc.
 Change style (next chapter) if you don’t like the
“look” of a heading
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 31
Common HTML Elements

Use pre to retain format of text and display
using monospace font:

Note that any embedded markup (such as
<br /> ) is still treated as markup!
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 32
Common HTML Elements

br element represents line break

br is example of an empty element, i.e.,
element that is not allowed to have content

XML allows two syntactic representations of
empty elements
 Empty tag syntax <br /> is recommended for
browser compatibility
 XML parsers also recognize syntax <br></br>
(start tag followed immediately by end tag), but
many browsers do not understand this for empty
elements
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 33
Common HTML Elements

Text can be formatted in various ways:
 Apply style sheet technology (next chapter) to a
span element (a styleless wrapper):
 Use a phrase element that specifies semantics
of text (not style directly):
 Use a font style element

Not recommended, but frequently used
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 34
Common HTML Elements
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 35
Common HTML Elements

Horizontal rule is produced using hr

Also an empty element

Style can be modified using style sheet
technology
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 36
Common HTML Elements

Images can be embedded using img element

Attributes:
 src: URL of image file (required). Browser
generates a GET request to this URL.
 alt: text description of image (required)
 height / width: dimensions of area that image will
occupy (recommended)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 37
Common HTML Elements

If height and width not specified for image,
then browser may need to rearrange the client
area after downloading the image (poor user
interface for Web page)

If height and width specified are not the same
as the original dimensions of image, browser
will resize the image

Default units for height and width are “picture
elements” (pixels)
 Can specify percentage of client area using string
such as “50%”
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 38
Common HTML Elements

Monitor resolution determines pixel size
768 lines
1024 elements per line
500 pixel wide line is almost
half the width of monitor
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 39
Common HTML Elements

Monitor resolution determines pixel size
1024 lines
1280 elements per line
500 pixel wide line is less
than half the width of monitor
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 40
Common HTML Elements

Hyperlinks are produced by the anchor element a

Clicking on a hyperlink causes browser to issue
GET request to URL specified in href attribute
and render response in client area

Content of anchor element is text of hyperlink
(avoid leading/trailing space in content)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 41
Common HTML Elements

Anchors can be used as source (previous
example) or destination

The fragment portion of a URL is used to
reference a destination anchor

Browser scrolls so destination anchor is at
(or near) top of client area
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 42
Common HTML Elements

Comments are a special form of tag

Not allowed to use -- within comment
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 43
Nesting Elements

If one element is nested within another
element, then the content of the inner
element is also content of the outer element

XHTML requires that elements be properly
nested
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 44
Nesting Elements

Most HTML elements are either block or
inline
 Block: browser automatically generates line
breaks before and after the element content

Ex: p,div
 Inline: element content is added to the “flow”

Ex: span, tt, strong, a
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 45
Nesting Elements

Syntactic rules of thumb:
 Children of body must be blocks
 Blocks can contain inline elements
 Inline elements cannot contain blocks

Specific rules for each version of (X)HTML
are defined using SGML or XML (covered
later)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 46
Relative URL’s

Consider an <img> start tag containing
attribute specification

This is an example of a relative URL: it is
interpreted relative to the URL of the
document that contains the img tag
 If document URL is
http://localhost:8080/MultiFile.html
then relative URL above represents absolute URL
http://localhost:8080/valid-xhtml10.png
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 47
Relative URL’s
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 48
Relative URL’s

Query and fragment portions of a relative
URL are appended to the resulting absolute
URL
 Example: If document URL is
http://localhost:8080/PageAnch.html
and it contains the anchor element
then the corresponding absolute URL is
http://localhost:8080/PageAnch.html#section1
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 49
Relative URL’s

Advantages:
 Shorter than absolute URL’s
 Primary: can change the URL of a document
(e.g., move document to a different directory or
rename the server host) without needing to
change URL’s within the document

Should use relative URL’s whenever
possible
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 50
Lists
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 51
Lists
Unordered List
Ordered List
Definition List
List Items
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 52
Lists
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 53
Tables
Rules
Rules
Borders
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 54
Tables
Table Row
Table Data
Border 5 pixels, rules 1 pixel
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 55
Tables
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 56
Tables
Table Header
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 57
Tables
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 58
Tables
cellspacing cellpadding
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 59
Tables
cellspacing cellpadding
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 60
Tables
cellspacing cellpadding
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 61
Frames
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 62
Frames
1/3,2/3 split
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 63
Frames

Hyperlink in one frame can load document in
another:

Value of target attribute specification is
id/name of a frame
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 64
Forms
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 65
Forms
Each form is content of a form element
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 66
Forms
action specifies URL where form data is sent in an HTTP request
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 67
Forms
HTTP request method (lower case)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 68
Forms

The XHTML grammar require any child of
the form element to be a block

Many form elements are actually inline, so
including a block element on top such a div
or a table is a simple way to be compliant
with the grammar
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 69
Forms
div is the block element analog of span (no-style block element)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 70
Forms
Form control elements must be content of a block element
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 71
Forms
Text field control (form user-interface element)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 72
Forms
Text field used for one-line inputs
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 73
Forms
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 74
Forms
Name associated with this control’s data in HTTP request
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 75
Forms
Width (number of characters) of text field
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 76
Forms
input is an empty element
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 77
Forms
Use label to associate text with a control
Only one control inside a label element!
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 78
Forms
Form controls are inline elements
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 79
Forms
textarea control used for multi-line input
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 80
Forms
Height and width in characters
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 81
Forms
textarea is not an empty element; any content is displayed
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 82
Forms
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 83
Forms
Checkbox control
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 84
Forms
Value sent in HTTP request if box is checked
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 85
Forms
Controls can share a common name
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 86
Forms
Submit button: form data sent to action URL if button is clicked
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 87
Forms
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 88
Forms
Form data (in GET request)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 89
Forms
Displayed on button and sent to server if button clicked
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 90
Forms
Radio buttons: at most
one can be selected at
a time.
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 91
Forms
Radio button control
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 92
Forms
All radio buttons with the same name form a button set
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 93
Forms
Only one button of a set can be selected at a time
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 94
Forms
This button is initially selected
(checked attribute also applies
to check boxes)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 95
Forms
Boolean attribute: default false,
set true by specifying name as
value
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 96
Forms
Represents string: >50
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 97
Forms
Menu
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 98
Forms
Menu control; name given once
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 99
Forms
Each menu item has its own value
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 100
Forms
Item initially displayed in menu
control
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 101
Forms

Other form controls:
 Fieldset (grouping)
 Password
 Clickable image
 Non-submit buttons
 Hidden (embed data)
 File upload
 Hierarchical menus
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 102
Forms
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 103
XML DTD

Recall that XML is used to define the syntax
of XHTML

Set of XML files that define a language are
known as the document type definition (DTD)

DTD primarily consists of declarations:
 Element type: name and content of elements
 Attribute list: attributes of an element
 Entity: define meaning of, e.g., &gt;
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 104
XML DTD

Example from
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
<!ELEMENT html (head, body)>
<!ATTLIST html
%i18n;
id ID #IMPLIED
xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml' >
<!ENTITY % i18n
"lang %LanguageCode; #IMPLIED
xml:lang %LanguageCode; #IMPLIED
dir (ltr|rtl) #IMPLIED" >
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 105
XML Element Type Declaration
Element type name
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 106
XML Element Type Declaration
Element type content specification (or content model)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 107
XML Element Type Declaration
Element type content specification (or content model)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 108
XML Element Type Declaration
Element type content specification (or content model)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 109
XML Element Type Declaration
Element type content specification (or content model)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 110
XML Element Type Declaration
Element type content specification (or content model)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 111
XML Element Type Declaration
Element type content specification (or content model)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 112
XML Element Type Declaration
Element type content specification (or content model)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 113
XML Element Type Declaration
Element type content specification (or content model)
<!ELEMENT textarea (#PCDATA)>
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 114
XML Element Type Declaration
Element type content specification (or content model)
<!ELEMENT textarea (#PCDATA)>
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 115
XML Element Type Declaration
Element type content specification (or content model)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 116
XML Element Type Declaration
Element type content specification (or content model)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 117
XML Element Type Declaration
Element type content specification (or content model)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 118
XML Element Type Declaration

Child elements of table are:
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 119
XML Element Type Declaration

Child elements of table are:
 Optional caption
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 120
XML Element Type Declaration

Child elements of table are:
 Optional caption followed by
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 121
XML Element Type Declaration

Child elements of table are:
 Optional caption followed by
 Any number of col elements
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 122
XML Element Type Declaration

Child elements of table are:
 Optional caption followed by
 Any number of col elements or
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 123
XML Element Type Declaration

Child elements of table are:
 Optional caption followed by
 Any number of col elements or any number of
colgroup elements
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 124
XML Element Type Declaration

Child elements of table are:
 Optional caption followed by
 Any number of col elements or any number of
colgroup elements then
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 125
XML Element Type Declaration

Child elements of table are:
 Optional caption followed by
 Any number of col elements or any number of
colgroup elements then
 Optional header
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 126
XML Element Type Declaration

Child elements of table are:
 Optional caption followed by
 Any number of col elements or any number of
colgroup elements then
 Optional header followed by
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 127
XML Element Type Declaration

Child elements of table are:
 Optional caption followed by
 Any number of col elements or any number of
colgroup elements then
 Optional header followed by optional footer
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 128
XML Element Type Declaration

Child elements of table are:
 Optional caption followed by
 Any number of col elements or any number of
colgroup elements then
 Optional header followed by optional footer then
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 129
XML Element Type Declaration

Child elements of table are:
 Optional caption followed by
 Any number of col elements or any number of
colgroup elements then
 Optional header followed by optional footer then
 One or more tbody elements
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 130
XML Element Type Declaration

Child elements of table are:
 Optional caption followed by
 Any number of col elements or any number of
colgroup elements then
 Optional header followed by optional footer then
 One or more tbody elements or
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 131
XML Element Type Declaration

Child elements of table are:
 Optional caption followed by
 Any number of col elements or any number of
colgroup elements then
 Optional header followed by optional footer then
 One or more tbody elements or one or more tr
elements
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 132
XML Attribute List Declaration
Element type name
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 133
XML Attribute List Declaration
Recognized
attribute names
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 134
XML Attribute List Declaration
Attribute types
(data types allowed as attribute values)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 135
XML Attribute List Declaration
ASCII characters: letter, digit, or . - _ :
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 136
XML Attribute List Declaration
Attribute value must be ltr or rtl
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 137
XML Attribute List Declaration
Like NMTOKEN but must begin with letter or _ :
Attribute value must be unique
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 138
XML Attribute List Declaration
Any character except XML special characters < and &
or the quote character enclosing the attribute value
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 139
XML Attribute List Declaration
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 140
XML Attribute List Declaration
Attribute default declarations
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 141
XML Attribute List Declaration
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 142
XML Entity Declaration

Entity declaration is essentially a macro

Two types of entity:
 General: referenced from HTML document using
&
Entity name
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 143
XML Entity Declaration

Entity declaration is essentially a macro

Two types of entity:
 General: referenced from HTML document using
&
Replacement text;
recursively replaced if it is a reference
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 144
XML Entity Declaration

Entity declaration is essentially a macro

Two types of entity:
 General: referenced from HTML document using
&
 Parameter: reference from DTD using %
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 145
XML Entity Declaration

Entity declaration is essentially a macro

Two types of entity:
 General: referenced from HTML document using
&
 Parameter: reference from DTD using %
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 146
DTD Files

DTD document contains element type,
attribute list, and entity declarations

May also contain declaration of external
entities: identifiers for secondary DTD
documents
System Identifier: URL for primary DTD document
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 147
DTD Files
External entity name
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 148
DTD Files
System identifier (relative URL)
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 149
DTD Files
Entity reference; imports content (entity declarations, called
entity set) of external entity at this point in the primary DTD
Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 150
HTML Creation Tools

Mozilla Composer

Microsoft FrontPage

Macromedia Dreamweaver

Etc.

More Related Content

PPTX
HTML and DHTML
PDF
WEB Module 1.pdf
PDF
PDF
Introduction to HTML
PPT
xhtml_css.ppt
PPTX
Web design - HTML (Hypertext Markup Language) introduction
PPTX
Final by smit parekh
PDF
HTML practical file
HTML and DHTML
WEB Module 1.pdf
Introduction to HTML
xhtml_css.ppt
Web design - HTML (Hypertext Markup Language) introduction
Final by smit parekh
HTML practical file

Similar to different Markup Languages like html xhtml (20)

PPTX
Web Design and Programming-Lab-4-HTML-II-Exercise
PPTX
Lec 2 Web.pptxLec 2 Web.pptxLec 2 Web.pptx
PPTX
Introduction to HTML- Week 3- HTMLSyntax
PPTX
Introduction to HTML.pptx
PPTX
41915024 html-5
PPTX
web design
PPTX
PPTX
PDF
WT Module-1.pdf
PPTX
9781285852645_CH01 research and analysis of data.pptx
PPT
HTML_JavaScript_Malaysia_2008 (2).ppt
PPTX
web unit 2_4338494_2023_08_14_23_11.pptx
PDF
Html5 deciphered - designing concepts part 1
PDF
Vskills certified html designer Notes
PPTX
Xhtml and html5 basics
PPT
Html book2
PPTX
PDF
Web Technologies - Chapter 3 of Front end path.pdf
PDF
WEB Mod1@AzDOCUMENTS.in (1).pdf
Web Design and Programming-Lab-4-HTML-II-Exercise
Lec 2 Web.pptxLec 2 Web.pptxLec 2 Web.pptx
Introduction to HTML- Week 3- HTMLSyntax
Introduction to HTML.pptx
41915024 html-5
web design
WT Module-1.pdf
9781285852645_CH01 research and analysis of data.pptx
HTML_JavaScript_Malaysia_2008 (2).ppt
web unit 2_4338494_2023_08_14_23_11.pptx
Html5 deciphered - designing concepts part 1
Vskills certified html designer Notes
Xhtml and html5 basics
Html book2
Web Technologies - Chapter 3 of Front end path.pdf
WEB Mod1@AzDOCUMENTS.in (1).pdf
Ad

Recently uploaded (20)

PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
master seminar digital applications in india
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Institutional Correction lecture only . . .
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Lesson notes of climatology university.
PDF
Computing-Curriculum for Schools in Ghana
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
O7-L3 Supply Chain Operations - ICLT Program
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Chinmaya Tiranga quiz Grand Finale.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
human mycosis Human fungal infections are called human mycosis..pptx
A systematic review of self-coping strategies used by university students to ...
Final Presentation General Medicine 03-08-2024.pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
master seminar digital applications in india
Microbial diseases, their pathogenesis and prophylaxis
Module 4: Burden of Disease Tutorial Slides S2 2025
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Institutional Correction lecture only . . .
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Lesson notes of climatology university.
Computing-Curriculum for Schools in Ghana
Anesthesia in Laparoscopic Surgery in India
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Ad

different Markup Languages like html xhtml

  • 1. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 1 Chapter 02 Markup Languages: XHTML 1.0 IT2353 WEB TECHNOLOGY
  • 2. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 2 HTML “Hello World!” Document Type Declaration Document Instance
  • 3. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 3 HTML “Hello World”
  • 4. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 4 HTML Tags and Elements  Any string of the form < … > is a tag  All tags in document instance of Hello World are either end tags (begin with </) or start tags (all others)  Tags are an example of markup, that is, text treated specially by the browser  Non-markup text is called character data and is normally displayed by the browser  String at beginning of start/end tag is an element name  Everything from start tag to matching end tag, including tags, is an element  Content of element excludes its start and end tags
  • 5. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 5 HTML Element Tree Root Element
  • 6. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 6 HTML Root Element  Document type declaration specifies name of root element: <!DOCTYPE html  Root of HTML document must be html  XHTML 1.0 (standard we will follow) requires that this element contain the xml namespace xmlns attribute specification (name/value pair)
  • 7. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 7 HTML head and body Elements  The body element contains information displayed in the browser client area  The head element contains information used for other purposes by the browser:  title (shown in title bar of browser window)  scripts (client-side programs)  style (display) information  etc.
  • 8. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 8 HTML History  1990: HTML invented by Tim Berners-Lee  1993: Mosaic browser adds support for images, sound, video to HTML  1994-~1997: “Browser wars” between Netscape and Microsoft, HTML defined operationally by browser support  ~1997-present: Increasingly, World-Wide Web Consortium (W3C) recommendations define HTML
  • 9. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 9 HTML Versions  HTML 4.01 (Dec 1999) syntax defined using Standard Generalized Markup Language (SGML)  XHTML 1.0 (Jan 2000) syntax defined using Extensible Markup Language (XML)  Primary differences:  HTML allows some tag omissions (e.g., end tags)  XHTML element and attribute names are lower case (HTML names are case-insensitive)  XHTML requires that attribute values be quoted
  • 10. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 10 SGML and XML
  • 11. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 11 HTML “Flavors”  For HTML 4.01 and XHTML 1.0, the document type declaration can be used to select one of three “flavors”:  Strict: W3C ideal  Transitional: Includes deprecated elements and attributes (W3C recommends use of style sheets instead)  Frameset: Supports frames (subwindows within the client area)
  • 12. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 12 HTML Frameset
  • 13. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 13 HTML Document Type Declarations  XHTML 1.0 Strict: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  XHTML 1.0 Frameset: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN“ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">  HTML 4.01 Transitional: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN“ "http://www.w3.org/TR/html4/loose.dtd">
  • 14. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 14 XHTML White Space  Four white space characters: carriage return, line feed, space, horizontal tab  Normally, character data is normalized:  All white space is converted to space characters  Leading and trailing spaces are trimmed  Multiple consecutive space characters are replaced by a single space character
  • 15. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 15 XHTML White Space
  • 16. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 16 XHTML White Space
  • 17. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 17 Unrecognized HTML Elements Misspelled element name
  • 18. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 18 Unrecognized HTML Elements title character data Belongs here
  • 19. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 19 Unrecognized HTML Elements title character data Displayed here
  • 20. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 20 Unrecognized HTML Elements  Browsers ignore tags with unrecognized element names, attribute specifications with unrecognized attribute names  Allows evolution of HTML while older browsers are still in use  Implication: an HTML document may have errors even if it displays properly  Should use an HTML validator to check syntax
  • 21. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 21 Unrecognized HTML Elements Example for non-frame browsers (old) <HTML> <HEAD> <TITLE>A simple frameset document</TITLE> </HEAD> <FRAMESET cols="20%, 80%"> <FRAME src="contents_of_frame1.html“ /> <FRAME src="contents_of_frame2.html“ /> <NOFRAMES> <P>This doc contains frames</P> </NOFRAMES> </FRAMESET> </HTML>
  • 22. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 22 HTML References  Since < marks the beginning of a tag, how do you include a < in an HTML document?  Use markup known as a reference  Two types:  Character reference specifies a character by its Unicode code point  For <, use &#60; or &#x3C; or &#x3c;  Entity reference specifies a character by an HTML- defined name  For <, use &lt;
  • 23. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 23 HTML References
  • 24. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 24 HTML References  Since < and & begin markup, within character data or attribute values these characters must always be represented by references (normally &lt; and &amp;)  Good idea to represent > using reference (normally &gt;)  Provides consistency with treatment of <  Avoids accidental use of the reserved string ]]>
  • 25. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 25 HTML References  Non-breaking space ( &nbsp; ) produces space but counts as part of a word  Ex: keep&nbsp;together keep&nbsp;together …
  • 26. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 26 HTML References  Non-breaking space often used to create multiple spaces (not removed by normalization) &nbsp; + space displays as two spaces
  • 27. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 27 XHTML Attribute Specifications  Example:  Syntax:  Valid attribute names specified by HTML recommendation (or XML, as in xml:lang)  Attribute values must be quoted (matching single or double quotes)  Multiple attribute specifications are space- separated, order-independent
  • 28. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 28 XHTML Attribute Values  Can contain embedded quotes or references to quotes  May be normalized by browser  Best to normalize attribute values yourself for optimal browser compatibility
  • 29. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 29 Common HTML Elements
  • 30. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 30 Common HTML Elements  Headings are produced using h1, h2, …, h6 elements:  Should use h1 for highest level, h2 for next highest, etc.  Change style (next chapter) if you don’t like the “look” of a heading
  • 31. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 31 Common HTML Elements  Use pre to retain format of text and display using monospace font:  Note that any embedded markup (such as <br /> ) is still treated as markup!
  • 32. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 32 Common HTML Elements  br element represents line break  br is example of an empty element, i.e., element that is not allowed to have content  XML allows two syntactic representations of empty elements  Empty tag syntax <br /> is recommended for browser compatibility  XML parsers also recognize syntax <br></br> (start tag followed immediately by end tag), but many browsers do not understand this for empty elements
  • 33. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 33 Common HTML Elements  Text can be formatted in various ways:  Apply style sheet technology (next chapter) to a span element (a styleless wrapper):  Use a phrase element that specifies semantics of text (not style directly):  Use a font style element  Not recommended, but frequently used
  • 34. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 34 Common HTML Elements
  • 35. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 35 Common HTML Elements  Horizontal rule is produced using hr  Also an empty element  Style can be modified using style sheet technology
  • 36. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 36 Common HTML Elements  Images can be embedded using img element  Attributes:  src: URL of image file (required). Browser generates a GET request to this URL.  alt: text description of image (required)  height / width: dimensions of area that image will occupy (recommended)
  • 37. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 37 Common HTML Elements  If height and width not specified for image, then browser may need to rearrange the client area after downloading the image (poor user interface for Web page)  If height and width specified are not the same as the original dimensions of image, browser will resize the image  Default units for height and width are “picture elements” (pixels)  Can specify percentage of client area using string such as “50%”
  • 38. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 38 Common HTML Elements  Monitor resolution determines pixel size 768 lines 1024 elements per line 500 pixel wide line is almost half the width of monitor
  • 39. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 39 Common HTML Elements  Monitor resolution determines pixel size 1024 lines 1280 elements per line 500 pixel wide line is less than half the width of monitor
  • 40. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 40 Common HTML Elements  Hyperlinks are produced by the anchor element a  Clicking on a hyperlink causes browser to issue GET request to URL specified in href attribute and render response in client area  Content of anchor element is text of hyperlink (avoid leading/trailing space in content)
  • 41. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 41 Common HTML Elements  Anchors can be used as source (previous example) or destination  The fragment portion of a URL is used to reference a destination anchor  Browser scrolls so destination anchor is at (or near) top of client area
  • 42. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 42 Common HTML Elements  Comments are a special form of tag  Not allowed to use -- within comment
  • 43. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 43 Nesting Elements  If one element is nested within another element, then the content of the inner element is also content of the outer element  XHTML requires that elements be properly nested
  • 44. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 44 Nesting Elements  Most HTML elements are either block or inline  Block: browser automatically generates line breaks before and after the element content  Ex: p,div  Inline: element content is added to the “flow”  Ex: span, tt, strong, a
  • 45. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 45 Nesting Elements  Syntactic rules of thumb:  Children of body must be blocks  Blocks can contain inline elements  Inline elements cannot contain blocks  Specific rules for each version of (X)HTML are defined using SGML or XML (covered later)
  • 46. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 46 Relative URL’s  Consider an <img> start tag containing attribute specification  This is an example of a relative URL: it is interpreted relative to the URL of the document that contains the img tag  If document URL is http://localhost:8080/MultiFile.html then relative URL above represents absolute URL http://localhost:8080/valid-xhtml10.png
  • 47. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 47 Relative URL’s
  • 48. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 48 Relative URL’s  Query and fragment portions of a relative URL are appended to the resulting absolute URL  Example: If document URL is http://localhost:8080/PageAnch.html and it contains the anchor element then the corresponding absolute URL is http://localhost:8080/PageAnch.html#section1
  • 49. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 49 Relative URL’s  Advantages:  Shorter than absolute URL’s  Primary: can change the URL of a document (e.g., move document to a different directory or rename the server host) without needing to change URL’s within the document  Should use relative URL’s whenever possible
  • 50. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 50 Lists
  • 51. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 51 Lists Unordered List Ordered List Definition List List Items
  • 52. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 52 Lists
  • 53. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 53 Tables Rules Rules Borders
  • 54. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 54 Tables Table Row Table Data Border 5 pixels, rules 1 pixel
  • 55. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 55 Tables
  • 56. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 56 Tables Table Header
  • 57. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 57 Tables
  • 58. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 58 Tables cellspacing cellpadding
  • 59. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 59 Tables cellspacing cellpadding
  • 60. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 60 Tables cellspacing cellpadding
  • 61. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 61 Frames
  • 62. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 62 Frames 1/3,2/3 split
  • 63. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 63 Frames  Hyperlink in one frame can load document in another:  Value of target attribute specification is id/name of a frame
  • 64. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 64 Forms
  • 65. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 65 Forms Each form is content of a form element
  • 66. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 66 Forms action specifies URL where form data is sent in an HTTP request
  • 67. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 67 Forms HTTP request method (lower case)
  • 68. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 68 Forms  The XHTML grammar require any child of the form element to be a block  Many form elements are actually inline, so including a block element on top such a div or a table is a simple way to be compliant with the grammar
  • 69. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 69 Forms div is the block element analog of span (no-style block element)
  • 70. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 70 Forms Form control elements must be content of a block element
  • 71. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 71 Forms Text field control (form user-interface element)
  • 72. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 72 Forms Text field used for one-line inputs
  • 73. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 73 Forms
  • 74. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 74 Forms Name associated with this control’s data in HTTP request
  • 75. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 75 Forms Width (number of characters) of text field
  • 76. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 76 Forms input is an empty element
  • 77. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 77 Forms Use label to associate text with a control Only one control inside a label element!
  • 78. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 78 Forms Form controls are inline elements
  • 79. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 79 Forms textarea control used for multi-line input
  • 80. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 80 Forms Height and width in characters
  • 81. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 81 Forms textarea is not an empty element; any content is displayed
  • 82. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 82 Forms
  • 83. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 83 Forms Checkbox control
  • 84. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 84 Forms Value sent in HTTP request if box is checked
  • 85. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 85 Forms Controls can share a common name
  • 86. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 86 Forms Submit button: form data sent to action URL if button is clicked
  • 87. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 87 Forms
  • 88. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 88 Forms Form data (in GET request)
  • 89. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 89 Forms Displayed on button and sent to server if button clicked
  • 90. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 90 Forms Radio buttons: at most one can be selected at a time.
  • 91. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 91 Forms Radio button control
  • 92. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 92 Forms All radio buttons with the same name form a button set
  • 93. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 93 Forms Only one button of a set can be selected at a time
  • 94. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 94 Forms This button is initially selected (checked attribute also applies to check boxes)
  • 95. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 95 Forms Boolean attribute: default false, set true by specifying name as value
  • 96. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 96 Forms Represents string: >50
  • 97. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 97 Forms Menu
  • 98. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 98 Forms Menu control; name given once
  • 99. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 99 Forms Each menu item has its own value
  • 100. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 100 Forms Item initially displayed in menu control
  • 101. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 101 Forms  Other form controls:  Fieldset (grouping)  Password  Clickable image  Non-submit buttons  Hidden (embed data)  File upload  Hierarchical menus
  • 102. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 102 Forms
  • 103. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 103 XML DTD  Recall that XML is used to define the syntax of XHTML  Set of XML files that define a language are known as the document type definition (DTD)  DTD primarily consists of declarations:  Element type: name and content of elements  Attribute list: attributes of an element  Entity: define meaning of, e.g., &gt;
  • 104. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 104 XML DTD  Example from http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd <!ELEMENT html (head, body)> <!ATTLIST html %i18n; id ID #IMPLIED xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml' > <!ENTITY % i18n "lang %LanguageCode; #IMPLIED xml:lang %LanguageCode; #IMPLIED dir (ltr|rtl) #IMPLIED" >
  • 105. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 105 XML Element Type Declaration Element type name
  • 106. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 106 XML Element Type Declaration Element type content specification (or content model)
  • 107. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 107 XML Element Type Declaration Element type content specification (or content model)
  • 108. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 108 XML Element Type Declaration Element type content specification (or content model)
  • 109. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 109 XML Element Type Declaration Element type content specification (or content model)
  • 110. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 110 XML Element Type Declaration Element type content specification (or content model)
  • 111. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 111 XML Element Type Declaration Element type content specification (or content model)
  • 112. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 112 XML Element Type Declaration Element type content specification (or content model)
  • 113. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 113 XML Element Type Declaration Element type content specification (or content model) <!ELEMENT textarea (#PCDATA)>
  • 114. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 114 XML Element Type Declaration Element type content specification (or content model) <!ELEMENT textarea (#PCDATA)>
  • 115. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 115 XML Element Type Declaration Element type content specification (or content model)
  • 116. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 116 XML Element Type Declaration Element type content specification (or content model)
  • 117. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 117 XML Element Type Declaration Element type content specification (or content model)
  • 118. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 118 XML Element Type Declaration  Child elements of table are:
  • 119. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 119 XML Element Type Declaration  Child elements of table are:  Optional caption
  • 120. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 120 XML Element Type Declaration  Child elements of table are:  Optional caption followed by
  • 121. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 121 XML Element Type Declaration  Child elements of table are:  Optional caption followed by  Any number of col elements
  • 122. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 122 XML Element Type Declaration  Child elements of table are:  Optional caption followed by  Any number of col elements or
  • 123. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 123 XML Element Type Declaration  Child elements of table are:  Optional caption followed by  Any number of col elements or any number of colgroup elements
  • 124. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 124 XML Element Type Declaration  Child elements of table are:  Optional caption followed by  Any number of col elements or any number of colgroup elements then
  • 125. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 125 XML Element Type Declaration  Child elements of table are:  Optional caption followed by  Any number of col elements or any number of colgroup elements then  Optional header
  • 126. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 126 XML Element Type Declaration  Child elements of table are:  Optional caption followed by  Any number of col elements or any number of colgroup elements then  Optional header followed by
  • 127. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 127 XML Element Type Declaration  Child elements of table are:  Optional caption followed by  Any number of col elements or any number of colgroup elements then  Optional header followed by optional footer
  • 128. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 128 XML Element Type Declaration  Child elements of table are:  Optional caption followed by  Any number of col elements or any number of colgroup elements then  Optional header followed by optional footer then
  • 129. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 129 XML Element Type Declaration  Child elements of table are:  Optional caption followed by  Any number of col elements or any number of colgroup elements then  Optional header followed by optional footer then  One or more tbody elements
  • 130. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 130 XML Element Type Declaration  Child elements of table are:  Optional caption followed by  Any number of col elements or any number of colgroup elements then  Optional header followed by optional footer then  One or more tbody elements or
  • 131. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 131 XML Element Type Declaration  Child elements of table are:  Optional caption followed by  Any number of col elements or any number of colgroup elements then  Optional header followed by optional footer then  One or more tbody elements or one or more tr elements
  • 132. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 132 XML Attribute List Declaration Element type name
  • 133. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 133 XML Attribute List Declaration Recognized attribute names
  • 134. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 134 XML Attribute List Declaration Attribute types (data types allowed as attribute values)
  • 135. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 135 XML Attribute List Declaration ASCII characters: letter, digit, or . - _ :
  • 136. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 136 XML Attribute List Declaration Attribute value must be ltr or rtl
  • 137. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 137 XML Attribute List Declaration Like NMTOKEN but must begin with letter or _ : Attribute value must be unique
  • 138. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 138 XML Attribute List Declaration Any character except XML special characters < and & or the quote character enclosing the attribute value
  • 139. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 139 XML Attribute List Declaration
  • 140. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 140 XML Attribute List Declaration Attribute default declarations
  • 141. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 141 XML Attribute List Declaration
  • 142. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 142 XML Entity Declaration  Entity declaration is essentially a macro  Two types of entity:  General: referenced from HTML document using & Entity name
  • 143. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 143 XML Entity Declaration  Entity declaration is essentially a macro  Two types of entity:  General: referenced from HTML document using & Replacement text; recursively replaced if it is a reference
  • 144. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 144 XML Entity Declaration  Entity declaration is essentially a macro  Two types of entity:  General: referenced from HTML document using &  Parameter: reference from DTD using %
  • 145. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 145 XML Entity Declaration  Entity declaration is essentially a macro  Two types of entity:  General: referenced from HTML document using &  Parameter: reference from DTD using %
  • 146. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 146 DTD Files  DTD document contains element type, attribute list, and entity declarations  May also contain declaration of external entities: identifiers for secondary DTD documents System Identifier: URL for primary DTD document
  • 147. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 147 DTD Files External entity name
  • 148. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 148 DTD Files System identifier (relative URL)
  • 149. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 149 DTD Files Entity reference; imports content (entity declarations, called entity set) of external entity at this point in the primary DTD
  • 150. Vejey Subash Gandyer :: IT2353 :: based on Jeffrey C. Jackson’s slides 150 HTML Creation Tools  Mozilla Composer  Microsoft FrontPage  Macromedia Dreamweaver  Etc.