Previous | Table of Contents | Next |
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:
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.
Take a look at figure 9.5. Its 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 stands for Hypermedia/Time-based Structuring Language and is a whole book in its own right. Its 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
The goals of HyTime and hypermedia in SGML include:
Some of the magic of HyTime comes from how it addresses multimedia objects. You can reference an object in real life in many ways:
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 |