Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 14

LECTURE 6

LECTURE 6

XHTML (Extensible Hyper Text Markup Language)

XHTML is a family of current and future document types and modules that reproduce, subset,
and extend HTML 4. XHTML family document types are XML based, and ultimately are
designed to work in conjunction with XML-based user agents.

XHTML 1.0 is a reformulation of the three HTML 4 document types as applications of XML
1.0. It is intended to be used as a language for content that is both XML-conforming and, if
some simple guidelines are followed, operates in HTML 4 conforming user agents. Developers
who migrate their content to XHTML 1.0 will realize the following benefits:

• XHTML documents are XML conforming. As such, they are readily viewed, edited,
and validated with standard XML tools.
• XHTML documents can be written to operate as well or better than they did before in
existing HTML 4-conforming user agents as well as in new, XHTML 1.0 conforming
user agents.
• XHTML documents can utilize applications (e.g. scripts and applets) that rely upon
either the HTML Document Object Model or the XML Document Object Model.
• As the XHTML family evolves, documents conforming to XHTML 1.0 will be more
likely to interoperate within and among various XHTML environments.

The XHTML family is the next step in the evolution of the Internet. By migrating to XHTML
today, content developers can enter the XML world with all of its attendant benefits, while still
remaining confident in their content's backward and future compatibility.

What is HTML (Hyper Text Markup Language) 4?

HTML 4 is an SGML (Standard Generalized Markup Language) application conforming to


International Standard ISO 8879, and is widely regarded as the standard publishing language of
the World Wide Web.

SGML is a language for describing markup languages, particularly those used in electronic
document exchange, document management, and document publishing. HTML is an example
of a language defined in SGML.

SGML has been around since the middle 1980's and has remained quite stable. Much of this
stability stems from the fact that the language is both feature-rich and flexible. This flexibility,
however, comes at a price, and that price is a level of complexity that has inhibited its adoption
in a diversity of environments, including the World Wide Web.

HTML, as originally conceived, was to be a language for the exchange of scientific and other
technical documents, suitable for use by non-document specialists. HTML addressed the
problem of SGML complexity by specifying a small set of structural and semantic tags suitable
for authoring relatively simple documents. In addition to simplifying the document structure,
HTML added support for hypertext. Multimedia capabilities were added later.

In a remarkably short space of time, HTML became wildly popular and rapidly outgrew its
original purpose. Since HTML's inception, there has been rapid invention of new elements for

Page 1 of 14
LECTURE 6

use within HTML (as a standard) and for adapting HTML to vertical, highly specialized,
markets. This plethora of new elements has led to interoperability problems for documents
across different platforms.

What is XML?

XML™ is the shorthand name for Extensible Markup Language.

XML was conceived as a means of regaining the power and flexibility of SGML without most
of its complexity. Although a restricted form of SGML, XML nonetheless preserves most of
SGML's power and richness, and yet still retains all of SGML's commonly used features.

While retaining these beneficial features, XML removes many of the more complex features of
SGML that make the authoring and design of suitable software both difficult and costly.

Why the need for XHTML?

The benefits of migrating to XHTML 1.0 are described above. Some of the benefits of
migrating to XHTML in general are:

• Document developers and user agent designers are constantly discovering new ways to
express their ideas through new markup. In XML, it is relatively easy to introduce new
elements or additional element attributes. The XHTML family is designed to
accommodate these extensions through XHTML modules and techniques for
developing new XHTML-conforming modules (described in the XHTML
Modularization specification). These modules will permit the combination of existing
and new feature sets when developing content and when designing new user agents.
• Alternate ways of accessing the Internet are constantly being introduced. The XHTML
family is designed with general user agent interoperability in mind. Through a new user
agent and document profiling mechanism, servers, proxies, and user agents will be able
to perform best effort content transformation. Ultimately, it will be possible to develop
XHTML-conforming content that is usable by any XHTML-conforming user agent.

XHTML in practise
• XHTML (Extensible HyperText Markup Language) is a markup language for creating web
• XHTML is based on HTML (HyperText Markup Language)—a legacy technology of the
World Wide Web Consortium (W3C).
• XHTML 1.0 allows only a document’s content and structure to appear in a valid XHTML
document, and not its formatting.

Editing XHTML
• A machine that runs a specialized piece of software called a web sewer stores XHTML
documents.

XHTML Example
• XHTML can be written in its source code form. XHTML documents are written by typing
them in a text editor (e.g., notepad, TextEdit) and saving them with an .html or an .htm file
extension.

Page 2 of 14
LECTURE 6

• In XHTML text is marked up with elements delimited by tags that are names contained in
pairs of angle brackets. Some elements may contain attributes that provide additional
information about the element.

• Every XHTML document contains a start <html> tag and an end </html> tag.
• Comments in XHTML always begin with <!-- and end with -->. The browser ignores all text
inside a comment.

• Every XHTML document contains a head element, which generally contains information,
such as a title, and a body element, which contains the page content. Information in the head
element generally is not tendered in the display window but may be made available to the user
through other means.
• The title element names a web page. The title usually appears in the colored bar (called the
title bar) at the top of the browser window and also appears as the text identifying a page when
users add your page to their list of Favorites or Bookmarks.

• The body of an XHTML document is the area in which the document’s content is placed. The
content may include text and tags.
• All text placed between the <p> and </p> tags forms one paragraph.

Page 3 of 14
LECTURE 6

W3C XHTML Validation Service

• XHTML documents that are syntactically correct are guaranteed to render properly. XHTML
documents that contain syntax errors may not display properly.
• Validation services (e.g., validator.w3. org) ensure that an XHTML document is syntactically
correct.

Headings
• XHTML provides six headings (h1 through h6) for specifying the relative importance of
information. Heading element h1 is considered the most significant heading and is rendered in
a larger font than the other five headings. Each successive heading element (i.e., h2, h3, etc.) is
rendered in a progressively smaller font.

Page 4 of 14
LECTURE 6

Linking
• Web browsers typically underline text hyperlinks and color them blue by default.
• The strong element typically causes the browser to render text in a bold font.
• Users can insert links with the a (anchor) element. The most important attribute for the a
element is href, which specifies the resource (e.g, page, file, e-mail address) being linked.
• Anchors can link to an e-mail address using a mailto: URL. ‘When someone clicks this type
of anchored link, most browsers launch the default e-mail program (e.g., Outlook Express) to
initiate an e-mail message addressed to the linked address.

Page 5 of 14
LECTURE 6

Images
• The img element’s src attribute specifies an image’s location, In a valid XHTML document
every img element must have an alt attribute, which contains text that is displayed if the client
cannot render the image.
• The alt attribute makes web pages more accessible to users with disabilities, especially those
with vision impairments.
• Some XHTML elements are empty elements that contain only attributes and do not mark up
text- Empty elements (e.g., img) must be terminated, either by using the forward clash
character (/) or by explicitly writing an end tag.

Page 6 of 14
LECTURE 6

Cascading Style Sheets (CSS)


Its a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
Inline Styles
• The inline style allows you to declare a style for an individual element by using the style
attribute in the element’s start tag.
• Each CSS property is followed by a colon and the value of the attribute. Multiple property
declarations are separated by a semicolon.
• The color property sets text color. Color names and hexadecimal codes may be used as the
value.

Page 7 of 14
LECTURE 6

Embedded Style Sheets


• Styles that are placed in a style element use selectors to apply style elements throughout the
entire document.
• style element attribute type specifies the MIME type (the specific encoding format) of the
style sheet. Style sheets use text/css.
• Each rule body in a style sheet begins and ends with a curly brace ({ and }).
• The font-weight property specifies the boldness” of text. Possible values are bold, normal (the
default), bolder (bolder than bold text) and lighter (lighter than normal text).
• Boldness also can be specified with multiples of 100, from 100 to 900 (e.g., 100, 200,..., 900).
Text specified as normal is equivalent to 400, and bold text is equivalent to 700.
• Style-class declarations are preceded by a period and are applied to elements of the specific
class. The class attribute applies a style class to an element.
• The CSS rules in a style sheet use the same format as inline styles: The property is followed
by a colon (:) and the value of that property. Multiple properties are separated by semicolons
(;).
• The background-color attribute specifies the background color of the element.
• The font-family attribute names a specific font that should be displayed. Generic font families
allow authors to specify a type of font instead of a specific font, in case a browser does not
support a specific font. The font-size property specifies the size used to render the font.

Page 8 of 14
LECTURE 6

Page 9 of 14
LECTURE 6

Positioning Elements
• The CSS position property allows absolute positioning, which provides greater control over
where on a page elements reside: Specifying an element’s position as absolute removes it from
the normal flow of elements-on the page and positions it according to distance from the top,
left, right or bottom margin of its parent element.
• The z-index property allows a developer to layer overlapping elements. Elements that have
higher a-index values are displayed in front of elements with lower z-index values.
• Unlike absolute positioning, relative positioning keeps elements in the general flow on the
page and offsets them by the specified top, left, right or bottom value.

Page 10 of 14
LECTURE 6

CSS3
• While CSS 2 is the current W3C Recommendation, CSS is in development, and some brows-
en are beginning to implement some of the new features that will be in the CSS 3 specification.

• CSS 3 will introduce new features related to borders, backgrounds, text effects, layout, and
more.

Page 11 of 14
LECTURE 6

Overview of three main categories of database architectures and their sub-


categories.

Today's database professionals face several options when considering architectures to employ
to address the various needs of their employers and/or clients.

Presented is an overview of three main categories of database architectures and their sub-
categories, as well as offer some insight into the benefits of each.

Application Logic
Database architectures can be distinguished by examining the way application logic is
distributed throughout the system. Application logic consists of three components:
Presentation Logic, Processing Logic, and Storage Logic.

The presentation logic component is responsible for formatting and presenting data on the
user's screen The processing logic component handles data processing logic, business rules
logic, and data management logic. Finally, the storage logic component is responsible for the
storage and retrieval from actual devices such as a hard drive or RAM.

By determining which tier(s) these components are processed on we can get a good idea of
what type of architecture and subtype we are dealing with.

One Tier Architectures


A good example of a one-tier database architecture is when a user runs Microsoft Access on
the user's local machine, and references a file that is stored on that machine's hard drive, thus
using a single physical resource to access and process information.

Another example of a one-tier architecture is a file server architecture. In this scenario, a


workgroup database is stored in a shared location on a single machine.

Workgroup members use a software package such as Microsoft Access to load the data and
then process it on their local machine. In this case, the data may be shared among different
users, but all of the processing occurs on the local machine. Essentially, the file-server is just
an extra hard drive from which to retrieve files.

One-tier architectures can be beneficial when we are dealing with data that is relevant to a
single user (or small number of users) and we have a relatively small amount of data. They are
somewhat inexpensive to deploy and maintain.

Two Tier Client/Server Architectures


A two-tier architecture is one that is familiar to many of today's computer users. A common
implementation of this type of system is that of a Microsoft Windows based client program that
accesses a server database such as Oracle or SQL (Structured Query Language) Server. Users

Page 12 of 14
LECTURE 6

interact through a GUI (Graphical User Interface) to communicate with the database server
across a network via SQL (Structured Query Language).

In two-tier architectures it is important to note that two configurations exist. A thin-client (fat-
server) configuration exists when most of the processing occurs on the server tier. Conversely,
a fat-client (thin-server) configuration exists when most of the processing occurs on the client
machine.

Two-tier architectures can prove to be beneficial when we have a relatively small number of
users on the system (100-150) and we desire an increased level of scalability.

N-Tier Client/Server Architectures


Most n-tier database architectures exist in a three-tier configuration. In this architecture the
client/server model expands to include a middle tier (business tier), which is an application
server that houses the business logic.

This middle tier relieves the client application(s) and database server of some of their
processing duties by translating client calls into database queries and translating data from the
database into client data in return.

Consequently, the client and server never talk directly to one-another.

A variation of the n-tier architecture is the web-based n-tier application. These systems
combine the scalability benefits of n-tier client/server systems with the rich user interface of
web-based systems.

Because the middle tier in a three-tier architecture contains the business logic, there is greatly
increased scalability and isolation of the business logic, as well as added flexibility in the
choice of database vendors.

Page 13 of 14
LECTURE 6

Three-Tier Client-Server Architecture

Page 14 of 14

You might also like