Ajax: Standards-based presentation using XHTML and CSS

Oct 13, 2008

Let's take a deeper approach to what both XHTML and CSS imply. Most persons from the IT world are familiar with the HyperText Markup Language, or HTML, which is basically the most common "spoken" language of the web. eXtensible HyperText Markup Language, XHTML, is the successor of plain HTML, and is in fact the HTML standard specified as an XML document and since 2000 is a World Wide Web Consortium recommendation. What differs is that where HMTL was somewhat facile and the browser made a reasonable attempt to display anything that was placed within tags, XHTML runs within an XML framework, meaning that if XML documents must be well formed so must the XHTML pages be. This is especially required in order to properly use the Document Object Model to gain access to different parts of the web page.

If HTML is an application of Standard Generalized Markup Language, or the SGML which is a very flexible markup language, XHTML is an application of XML, a more restrictive subset of SGML. Due to their need of well-formating, true XHTML documents permit automated processing to be executed using standard XML tools, unlike HTML which requires a more complex, lenient and overall custom parser.

The XHTML family was revised in August 2002, according to W3C, as being " 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."

Cascading Style Sheets, or the CSS, are the templates behind HTML pages that describe the presentation and layout of the text and data contained within the actual HTML page. The importance of the CSS comes from the developer who makes changes to the style sheet that are instantly depicted in the display of the page. CSS properties are also accessible via the Document Object Model which we will discuss further on in this article.

CSSs may be subject to local use by viewers of web pages in order to define colors, fonts, layout and other elements of a document presentation. Its primary purpose is to enable the separation of document content which is written in XHTML, from document presentation. By separating the two components, content accessibility is improved, more flexibility and control in the specification of presentation characteristics are provided, and complexity and repetition in the structural content are reduced. CSS also enables the same markup page to be presented in different styles for different rendering methods, such as on-screen, in print, by voice, on Braille-based or tactile devices. This is done by specifying a priority scheme to determine which style rules apply if more than one rule matches against a particular element. This is the so called cascade, where priorities or weights are calculated and assigned to rules, so that these rules would be predictable.

Although having a style sheet is not completely necessary, in order to maintain a proper organization style sheets are definitely an indispensable aid. Among other advantages of using style sheets is that by combining CSS with the functionality of a Content Management System, a considerable amount of flexibility can be programmed into content submission forms. This feature enables an editor or any person not familiar with CSS or HTML code editing to select the layout of a article or entire page in the same form. The information the editor inputs into the Content Management System is logically evaluated by the program and, based on a certain number of combinations, the program determines in which way to apply classes and Ids to the XHTML elements, styling them and positioning them as the pre-defined CSS dictated. This is really beneficial when working with large-scale, complex sites that have many contributors like news and informational sites, where this advantage influences to a great extent the feasibility and maintenance of the website.

Read more about it:

Ajax Technology - an Introduction
1. Standards-based presentation using XHTML and CSS
2. Dynamic display and interaction using Document Object Model
3. Data interchange and manipulation using XML and XSLT
4. Asynchronous data retrieval using XMLHttpRequest
5. JavaScript that binds everything together



Recent articles

Tax Management
Aug 17, 2017
DICOM Processing
Aug 17, 2017
Tree Viewer
Aug 17, 2017
Time Tracker
Aug 16, 2017
Press  |  Site Map  |  Technologies  |  Terms of Use  |  Privacy Policy
© 2019 SBP Romania. All rights reserved.