Re-framing content with XFrames (1/2) - exploring XML
Re-framing content with XFrames
While whole countries go on vacation in August, the W3C churns out one candidate specification after the next. Determined to fix the problems that HTML accumulated over its ten years of development, the frameset feature is under review.
Introduced in HTML4, frames were invented as a mechanism to combine multiple HTML documents into one view. The goal was to simplify the layout of Web application interfaces by allowing various components such as headers, footers, and menus to be assembled into one set of frames. Alas, the use of frames created some usability problems:
- The browser's
backbutton creates surprising results in many cases.
- A collection of documents in a frameset cannot be bookmarked.
- Reloading a page can give unexpected results.
- Scrolling a frameset is often hard to do, with unclear results.
- Searching finds HTML pages, not framed pages, delivering results without the navigation context that they were intended to be in.
- Many framed pages are not indexed by search engines because
noframesmarkup is necessary but not mandatory.
- Frames create security problems because, unknown to the user, different frames can come from different sources.
XFrames elements and attributes
XFrames defines a separate XML application, not a part of XHTML per se, that allows similar functionality to HTML Frames, with fewer usability problems, principally by making the content of the frameset visible in its URI. The XFrames Module supports the following element and attributes:
|frames||class (NMTOKENS), id (ID), title (CDATA), xml:base (URI)||head?, (row | column | frame+)|
|head||class (NMTOKENS), id (ID), title (CDATA)||title, style*|
|title||class (NMTOKENS), id (ID), title (CDATA)||PCDATA|
|style||class (NMTOKENS), id (ID), title (CDATA), type* (ContentType)||PCDATA|
|row||class (NMTOKENS), id (ID), title (CDATA)||(column | frame)+|
|column||class (NMTOKENS), id (ID), title (CDATA)||(row | frame)+|
Most elements are familiar from the HTML standard:
a specification for composing several documents,
potentially of different types, together in a view, just like an HTML frameset.
An optional attribute |
contains meta-data about the document,
specifying a title, and a style sheet. Use of the |
|title||contains an identifying text for the document, that may be used by a user agent to label the document.|
allows the specification of styling
instructions that affect the presentation of the frames in the document. The
|row||specifies a series of columns and single frames. The columns and single frames are placed next to each other horizontally, from left to right.|
|column||specifies a series of rows and single frames. The rows and single frames are placed one above the other, from top to bottom.|
a place holder for the content of a
document. It has one additional attribute,
All elements can have the following attributes:
This attribute assigns a name to an element. This name must be unique in an XFrames document. It may be used as a style sheet selector, a target anchor for hypertext links or as a means to reference a particular element for general purpose processing by user agents.
This attribute assigns a class name or set of class names to an element. Any number of elements may be assigned the same class name or names. Multiple class names must be separated by white space characters. It may be used as a style sheet selector (when an author wishes to assign style information to a set of elements) or for general purpose processing by user agents.
|This attribute offers advisory information about the element for which it is set. It may be used to document the purpose of a frame, and may be useful for non-visual user agents to help the user understand the structure of a set of frames.|
The examples assume at least a surrounding
xmlns="http://www.w3.org/2002/06/xframes"> element. The
id attributes have been omitted from the
elements for clarity.
------- | | | | | | | | | -------
------- | | | |---| | | | | -------
Now we look at the process of populating a frameset.
Produced by Michael Claßen
Created: Sep 02, 2002
Revised: Sep 02, 2002