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
back
button 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
noframes
markup 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:
Element | Attributes | Content Model |
---|---|---|
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)+ |
frame | EMPTY |
Most elements are familiar from the HTML standard:
Element | Description |
---|---|
frames |
a specification for composing several documents,
potentially of different types, together in a view, just like an HTML frameset.
An optional attribute xml:base exists for specifying a base URL
used for resolving relative URIs when populating frames within the document. |
head |
contains meta-data about the document,
specifying a title, and a style sheet. Use of the META element
and RDF is under consideration. |
title | contains an identifying text for the document, that may be used by a user agent to label the document. |
style |
allows the specification of styling
instructions that affect the presentation of the frames in the document. The
required type attribute specifies the style sheet language of the
element's contents, e.g. "text/css." |
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. |
frame |
a place holder for the content of a
document. It has one additional attribute,
source , specifying a URI-reference for a default document to
populate the frame, if that is not done via a parameter to the frameset
document's URI. |
Common Attributes
All elements can have the following attributes:
id
|
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. |
---|---|
class
|
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. |
title
| 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. |
Examples
The examples assume at least a surrounding <frames
xmlns="https://www.w3.org/2002/06/xframes">
element. The
id
attributes have been omitted from the frame
elements for clarity.
Layout | Specification |
---|---|
------- | | | | | | | | | ------- |
|
------- | | | |---| | | | | ------- |
|
Now we look at the process of populating a frameset.
Produced by Michael Claßen
URL: https://www.webreference.com/xml/column63/index.html
Created: Sep 02, 2002
Revised: Sep 02, 2002