W3C

XFrames

W3C Working Draft 6 August 2002

This version:
http://www.w3.org/TR/2002/WD-xframes-20020806
Latest version:
http://www.w3.org/TR/xframes
Editor:
Steven Pemberton, CWI/W3C

Abstract

XFrames, an XML application for composing documents together, replacing HTML Frames.

Status of This Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. The latest status of this document series is maintained at the W3C.

This is the first public Working Draft of this specification for review by W3C Members and other interested parties. It is guaranteed to change; anyone implementing it should realize that we will not allow ourselves to be restricted by experimental implementations when deciding whether to change the specification.

This document has been produced by the W3C HTML Working Group (members only) as part of the W3C HTML Activity. Publication as a Working Draft does not imply endorsement by the W3C Membership, nor of members of the HTML Working Group.

Comments on this document should be sent to www-html-editor@w3.org (archive). Public discussion on this document may take place on www-html@w3.org (archive).

At the time of publication, the Working Group believed there were zero patent disclosures relevant to this specification. A current list of patent disclosures relevant to this specification may be found on the Working Group's patent disclosure page.

This document may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress". A list of current W3C Recommendations and other technical documents can be found at http://www.w3.org/TR.

Contents

1. Introduction

This section is informative.

Frames were introduced into HTML at version 4.0 [HTML4]. They introduced a manner of composing several HTML documents into a single view to create an application-like interface.

However, Frames introduced several usability problem that caused several commentators to advise Web site builders to avoid them at all costs. Examples of such usability problems are:

This document 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.

2. XFrames

This section is normative.

This specification defines an XML application called XFrames. It uses the XML Namespaces [NAME] identifier: http://www.w3.org/2002/06/xframes

All examples in this document are informative.

The remainder of this section describes the elements and attributes in XFrames, and their semantics.

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

class (NMTOKENS), id (ID), title (CDATA), source (URI)

EMPTY

Implementation: DTD

2.1. The frames Element

An XFrames document is a specification for composing several documents, potentially of different types, together in a view. The frames element forms the container for the composed document. The individual sub-documents ('frames') may be composed together in a rectangular space by placing them next to, or above, each other in rows and columns, or they may be displayed as separate movable window-like panes, or as tabbed panes, or in any other suitable manner. The collection of frames in an XFrames document is referred to as a frameset. The frames element has the following additional attribute on top of the set of attributes common to all elements:

xml:base
Used for resolving relative URIs when populating frames within the document. See [XMLBASE].

2.2. The head Element

The head element contains meta-data about the document, specifying a title, and a style sheet.

[[Issue: Include meta? Include RDF?]]

2.3. The title Element

The title element contains an identifying text for the document, that may be used by a user agent to label the document.

2.4. The style Element

The style element 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. The style sheet language is specified as a content type (e.g., "text/css"). A value must be supplied for this attribute; there is no default value.

2.5. The row Element

The row element specifies a series of columns and single frames. The columns and single frames are placed next to each other horizontally, from left to right.

2.6. The column Element

The column element specifies a series of rows and single frames. The rows and single frames are placed one above the other, from top to bottom.

2.7. The frame Element

The frame element is a place holder for the content of a document. It has one additional attribute:

source
This attribute specifies 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.

2.8. Common 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.

2.8 Examples

All these examples assume at least a surrounding <frames xmlns="http://www.w3.org/2002/06/xframes"> element. The id attributes have been omitted from the frame elements for clarity.

  1. To place two documents next to each other, you specify
    <row><frame/><frame/></row>
  2. To put two documents one above the other, you specify
    <column><frame/><frame/></column>
  3. To specify a layout that looks like the following
     -------
    |   |   |
    |---|   |
    |   |   |
     -------

    you specify

    <row>
        <column>
            <frame/>
            <frame/>
        </column>
        <frame/>
    </row>
  4. A layout like
     -------
    |   |   |
    |-------|
    |       |
     -------

    you specify as

    <column>
        <row>
            <frame/>
            <frame/>
        </row>
        <frame/>
    </column>
  5. A layout like
     -----
    |     |
    |-----|
    |  |  |
    |-----|
    |     |
     -----

    you specify

    <column>
        <frame/>
        <row>
            <frame/>
            <frame/>
        </row>
        <frame/>
    </column>
  6. A layout like
     -----
    |  |  |
    |-----|
    |  |  |
     -----

    can be specified as either a column of two rows, or a row of two columns:

    <column>
        <row>
            <frame/>
            <frame/>
        </row>
        <row>
            <frame/>
            <frame/>
        </row>
    </column>

    or

    <row>
        <column>
            <frame/>
            <frame/>
        </column>
        <column>
            <frame/>
            <frame/>
        </column>
    </row>

3. Populating a Frameset

An XFrames document is referenced by a URI [URI] of the form http://example.org/home.frm#frames(id1=uri1,id2=uri2,...). Each id identifies a frame element within the document with an id attribute with that value. Each associated URI is then assigned to that frame. If there is no frame with that id, the URI is ignored. If a frame within the document is not populated (because it has no id attribute, or because there is no parameter that uses its id), and it has a source attribute, the URI in that attribute is used instead. If an unpopulated frame has no source attribute, the frame is left blank.

Relative parameter URIs are interpreted relative to the XFrames document, taking into account any xml:base [XMLBASE] value on the <frames> element.

Having associated URIs to the frames, the XFrames document is displayed accordingly.

For example, in a document home.xfm, describing the following layout

 -------
|   |   |
|---|   |
|   |   |
 -------

as

<row>
    <column>
        <frame id="a"/>
        <frame id="b"/>
    </column>
    <frame id="c" source="main.xml"/>
</row>

and populated as follows

home.xfm#frames(a=one.xhtml,b=two.xhtml,c=three.xhtml)

the frames would be populated by assigning one.xhtml to the frame with id="a", two.xhtml to the frame with id="b", and three.xhtml to the frame with id="c":

 -------
| 1 |   |
|---| 3 |
| 2 |   |
 -------

Populated as follows:

home.xfm#frames(a=one.xhtml,b=two.xhtml)

the frame with id="c" would be populated with main.xml.

Populated as follows

home.xfm#frames(a=one.xhtml)

the frame with id="b" would additionally be left blank.

Populated as follows:

home.xfm#frames(z=nav.xml)

the frames with id="a" and id="b" would be blank, and the frame with id="c" would be associated with main.xml (and nav.xml would be ignored).

3.1. Links and Targets

If a document assigned to a frame contains hyperlinks, and one of these is activated by some means (such as by the user clicking on it), then the URI of that hyperlink is normally assigned to the frame instead, and the XFrames document is redisplayed.This changes the URI associated with the frameset, by adding or replacing an association between the frame and the URI for the frame document; this would normally be visible to the user. If the frame containing the document does not have an id attribute, so that such an association is not possible, the entire frameset is replaced by the linked-to document.

If the hyperlink is in some way targetted (for instance by being associated with a target attribute in XHTML 1.0 [XHTML]), then in the containing frameset a frame with an id equal to the target is located, and the URI is associated with that frame instead. If the current frameset contains no such id, but the frameset is associated with a frame in another frameset, then the process continues with that frameset, and so on. If no matching id is found, then the targetted resource is processed in an entirely new environment (for instance, a visual browser might open a new window).

4. Sizing, Styling and Rendering of Frames

All styling, positioning, and sizing of frames is done using a style sheet in CSS or some other suitable styling language. This means that there is nothing normative in the names <row> and <column> except a suggestion on how they should be rendered, and a default presentation in the absence of a stylesheet. If the <frames> element contains only <frame> elements (and no <row> and <column> elements), the default is to render them as tabbed or overlapping panes.

In the absence of height and width information from a style sheet, rows and columns are divided equally over the space available to them without regards to their content (so in a column of three frames, each frame is allocated one third of the height of the column; with a column of two frames and a row, the row is still allocated one third of the height of the column, even if the row itself contains more columns; in a column of three frames where one frame has been assigned a height, the remaining space is divided over the other two frames).

Note that the stylesheet in an XFrames document has no effect on the contents of any frame.

[[Issue: applying stylesheets to contents of frames? <frame stylesheet="override.css"/>]]

[[Issue: use the CSS table layout algorithm instead?]]

[[Issue: require a minimum level of CSS for setting widths and heights as percentages, so that in the absence of a CSS you still have some interoperable control over layout?]]

[[Issue: add additional suggestive elements, such as <tabbed>?]]

5. Documents Assigned to Frames

This specification does not require conformant XFrames user agents to accept or refuse any particular type of document for assignment to a frame.

A. DTD Implementation

This appendix is normative.

[To come]

B. References

This appendix is normative.

B.1. Normative References

[NAME]
"Namespaces in XML", W3C Recommendation, T. Bray, D. Hollander, A. Layman, eds., 14 January 1999.
Available at: http://www.w3.org/TR/1999/REC-xml-names-19990114
The latest version is available at: http://www.w3.org/TR/REC-xml-names
[URI]
"RFC2396: Uniform Resource Identifiers (URI): Generic Syntax", T. Berners-Lee, R. Fielding, L. Masinter, August 1998.
Available at: http://www.rfc-editor.org/rfc/rfc2396.txt
[XMLBASE]
"XML Base", W3C Recommendation, J. Marsh, ed., 27 June 2001.
Available at: http://www.w3.org/TR/2001/REC-xmlbase-20010627
The latest version is available at: http://www.w3.org/TR/xmlbase

B.2. Other References

[CSS2]
"Cascading Style Sheets, level 2 (CSS2) Specification", W3C Recommendation, B. Bos, H. W. Lie, C. Lilley, I. Jacobs, eds., 12 May 1998.
Available at: http://www.w3.org/TR/1998/REC-CSS2-19980512
The latest version is available at: http://www.w3.org/TR/REC-CSS2
[HTML4]
"HTML 4.01 Specification", W3C Recommendation, D. Raggett, A. Le Hors, I. Jacobs, eds., 24 December 1999.
Available at: http://www.w3.org/TR/1999/REC-html401-19991224
The latest version is available at: http://www.w3.org/TR/html4
[XHTML]
"XHTML™ 1.0 The Extensible HyperText Markup Language (Second Edition): A Reformulation of HTML 4 in XML 1.0", W3C Recommendation, S. Pemberton et al., 1 August 2002.
Available at: http://www.w3.org/TR/2002/REC-xhtml1-20020801
The latest version is available at: http://www.w3.org/TR/xhtml1

C. Acknowledgments

This section is informative.

At the time of publication, the members of the W3C HTML Working Group were:

List will be inserted when this document becomes a Recommendation.