Section 3.9. Editorial Markup


3.9. Editorial Markup

HTML 4.0 introduced two tags that can help groups of authors collaborate in the development of documents and maintain some semblance of editorial and version control. The insert ( <ins> ) and delete ( <del> ) tags respectively let you either designate portions of your document's body as new or added content or designate old stuff that should be replaced . And with special attributes, you can indicate when you made the change ( datetime ) and a reference to a document that may explain the change ( cite ).

3.9.1. The <ins> and <del> Tags

The <ins> and <del> tags let authors set off portions of body content that they intend to add to or delete from the current versions of their documents. HTML 4/XHTML-compliant browsers display the contents of the <ins> and <del> tags in some special way so that readers can quickly scan the document for the changes.

<ins> and <del>

Function

Define inserted and deleted document content (see Figure 3-4)

Attributes

cite , class , datetime , dir , id , lang , onClick , onDblClick , onKeyDown , onKeyPress , onKeyUp , onMouseDown , onMouseMove , onMouseOut , onMouseOver , onMouseUp , style , title

End tag

</ins> and </del> ; never omitted

Contains

body_content

Used in

body_content



Netscape 4 and earlier versions ignore the tags, as did Internet Explorer 4 and its earlier versions. All current popular browsers now support the tags.

Figure 3-4. The <ins> and <del> tags in action

3.9.1.1. The cite attribute

The cite attribute lets you document the reasons for the insertion or deletion. Its value must be a URL that points to some other document that explains the inserted/deleted text. How a browser treats cite is a question for the future.

3.9.1.2. The datetime attribute

Although the reason for the change is important, knowing when a change was made is often more important. The datetime attribute for the <ins> and <del> tags takes a single value: a specially encoded date and timestamp. The rigorous format for the datetime value is YYYY-MM-DDThh:mm:ssTZD . The components are:

  • YYYY is the year, such as 1998 or 2010.

  • MM is the month; 01 for January through 12 for December.

  • DD is the day; 01 through 31.

  • T is a required character designating the beginning of the time segment of the stamp.

  • hh is the hour in 24- hour format; 00 (midnight) through 23 (11 p.m.). (Add a following colon if you include the minutes.)

  • mm are the minutes on the hour; 00 through 59. (Add a following colon if you include the seconds.)

  • ss are the seconds; 00 through 59.

  • TZD is the time-zone designator. It can be one of three values: Z , indicating Greenwich Mean Time, [*] or the hours, minutes, and seconds before ( - ) or after ( + ) Coordinated Universal Time (UTC), where time is relative to the time in Greenwich, England.

    [*] Greenwich Mean Time is also know as "Zulu," thus the value of "Z."

For example:

 2007-02-22T14:26Z 

decodes to February 22, 2007 at 2:26 p.m. Greenwich Mean Time. To specify Eastern Standard Time, the code for the same time and date is:

 2003-02-22T09:26-05:00 

Notice that the local time zone may change depending on where the document gets edited, whereas the universal time will stay the same.

3.9.1.3. The class, dir, event, id, lang, style, title, and events attributes

There are several nearly universal attributes for the many HTML and XHTML tags. These attributes give you a common way to identify ( title ) and label ( id ) a tag's contents for later reference or automated treatment, to change the contents' display characteristics ( class , style ), and to reference the language used ( lang ) and related direction the text should flow ( dir ). There are also input events that may happen in and around the tagged contents that you may react to via an on-event attribute and some programming. [The dir attribute, 3.6.1.1] [The lang attribute, 3.6.1.2] [The id attribute, 4.1.1.4] [The id attribute, 4.1.1.4] [Inline Styles: The style Attribute, 8.1.1] [Style Classes, 8.3] [JavaScript Event Handlers, 12.3.3]

3.9.2. Using Editorial Markup

The uses of <ins> and <del> are obvious to anyone who has used a " boilerplate " document or form or has collaborated with others in the preparation of a document.

For example, law firms typically have a collection of online legal documents that are specially completed for each client. Law clerks usually do the "fill in," and the final document gets reviewed by a lawyer. To highlight those changes in the document so that they are readily evident to the reviewer, you might use the <ins> tag to indicate added text and the <del> tag to mark the text that was replaced. Optionally, use the cite and datetime attributes to indicate why and when the changes were made.

For example, the clerk might fill in a boilerplate document with the law firm's and representative's names , indicating the time and source for the change:

 The party of the first part, as represented by <ins datetime=2002-06-22T08:30Z      cite="http://www.mull+dull.com/tom_muller.html"> Thomas Muller of Muller and Duller </ins> <del>[insert representation here]</del> 

The editorial markup tags could also be used by editing tools to denote how documents were modified as authors make changes over a period of time. With the correct use of the cite and datetime attributes, it would be possible to recreate a version of a document from a specific point in time.



HTML & XHTML(c) The definitive guide
Data Networks: Routing, Security, and Performance Optimization
ISBN: 596527322
EAN: 2147483647
Year: 2004
Pages: 189
Authors: Tony Kenyon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net