Previous Table of Contents Next


Adding a Graphic

Figure 9.4 shows a call to a JPEG graphic called IDUNNO.JPG from an HTML document.


Fig. 9.4  The call to IDUNNO.JPG is made with the SRC attribute inside the <IMG> element.

The basic syntax is:

     <P><IMG src "idunno.jpg" align="top"></P>

The <P> element is a paragraph tag. The <IMG> element stands for image. Their corresponding definitions in the HTML 2.0 DTD are:

     <!--==============Images========================-->
     <!ELEMENT  IMG     - O  EMPTY
     <!ATTLIST  IMG
               SRC  %URI;     #REQUIRED
               ALT  CDATA     #IMPLIED
               ALIGN (top|middle|bottom)  #IMPLIED
               ISMAP (ISMAP)  #IMPLIED
               %SDAPREF;  "<Fig><?SDATrans Img: AttList>#AttVal(Alt)</Fig>"
                >
     <!-- <IMG>                Image; icon, glyph or illustration -->
     <!-- <IMG SRC="...">      Address of image object            -->
     <!-- IMG ALT="...">       Textual alternative                -->
     <!-- IMG ALIGN=...>       Position relative to text          -->
     <!-- IMG ISMAP>           Each pixel can be a link           -->

The documentation in this DTD excerpt clearly tells what each element means and gives an example of its use. The comment lines are valuable.

The DTD calls an element that is used only for loading images, and the document instance deploys it with the address of the desired image file. The DTD and the document instance must work together.

The process is simple. You tag the document feature with the appropriate tag and use attributes to locate the binary file. The ALIGN attribute locates the file. You can set it up differently in another SGML application, of course. The steps are:

1.  Tag the object with the correct element.
2.  Reference the file with an attribute.
3.  Locate the file on your system or network with the value of the attribute.


Tip:  
If you can do this three-step approach, you can keep many applications running correctly. Other applications of SGML get even more involved. For example, check out how the TEI p3 DTD handles image and similar files; see http://www.sil.org/sgml/acadapps.html#tei.

Adding a Sound or Video File

Take a look at figure 9.5. It’s from the Web home page for the TV Themes Home Page.


Fig. 9.5  The TV Themes Home Page makes calls to different kinds of multi-media files.

The sound files include alenat.au, amaze.au, and automan.au. Notice the anchor element <A> and the attribute HREF. The pattern is the same as with hypertext links. How the file gets viewed or played depends on the viewing tool. Web browsers enable you to configure external viewing software to handle it. You can configure your own DTD with macros to launch specific applications, but that makes your SGML documents less portable.

HyTime

HyTime stands for Hypermedia/Time-based Structuring Language and is a whole book in its own right. It’s a structured method for expressing relationships among multi-media objects in a document. The internal coding and processing semantics of these objects are ignored by SGML, just as graphics formats that are not standardized are ignored. HyTime, like SGML, does not define a language or even a single application. Instead, it is the seed from which many applications can grow while remaining compatible with SGML standards. You can think of HyTime as the SGML Hypermedia standard. Developers use it to design multimedia environments for SGML applications.


• See “HyTime: SGML and Hypermedia,” p. 385

• See “HyTime,” p. 524


Goals of HyTime

The goals of HyTime and hypermedia in SGML include:

  To link different document and DTD structures without changing the structures themselves or their content.
  To link hypertext and hypermedia documents and files as objects.
  To provide guidelines for the modular structuring of hypermedia links so that applications can support many kinds of external applications.
  To link documents and files as objects irrespective of time sequencing, platform, and native software.
  To link to any structural levels of any file, not just logical components or elements.
  To enable anyone affected by a link to maintain it without altering the work of others.

Addressing

Some of the magic of HyTime comes from how it addresses multimedia objects. You can reference an object in real life in many ways:

  By a unique name; for example, “Bring me the Craftsman three-quarter-inch drive socket, serial number 34n368c.”
  By its position in Cartesian space; for example, “Bring me the object that is located 10 feet due southwest of my position, at an altitude of 36 inches.”
  By its location relative to some other object; for example, “Bring me the wrench on the table next to the paint can.”

Normal SGML hyperlinks often require a unique name, as in the first example of addressing above. ID and IDREF, which you learn about in Chapter 14, are normal ways of referring to a document or a file with SGML. You can locate and reference individual entities and elements with their IDs, thereby creating a link. HyTime adds even more flexibility and robustness in addressing objects of many kinds.


• See “Identifying Internal and External Objects (ID & IDREF),” p. 251


Previous Table of Contents Next