home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Platinum Edition Using HTML 4, XML, and Java 1.2
(Publisher: Macmillan Computer Publishing)
Author(s): Eric Ladd
ISBN: 078971759x
Publication Date: 11/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


System Identifier

A system identifier is a URI (uniform resource identifier), which may be used to retrieve the DTD. If you’ve ever opened a Web page in a browser or downloaded a file from an FTP site, you have already seen one form of a URI called a URL (uniform resource locator). URLs are special forms of URIs intended for network (Internet) use. You will see the more technically precise name of URI used more often than URL, but for the majority of uses, the two terms are virtually interchangeable.

A system identifier can reference an absolute location, as in

<!DOCTYPE book SYSTEM “/mount/usr/home/dtds/book.dtd”>
<!DOCTYPE book SYSTEM “http://wwwin.synopsys.com/~north/dtds/book.dtd”>

or it can be a reference to a relative location:

<!DOCTYPE book SYSTEM “dtds/book.dtd”>
<!DOCTYPE book SYSTEM “../../dtds/book.dtd”>

Public Identifier

A public identifier is the officially recorded identifier for a DTD. Obviously, it would be impossible to register every DTD. Instead, the person or company who creates DTD registers itself. The International Standards Organization (ISO) is responsible under the provisions of ISO 9070 for the registrations, but authority to issue identifiers and the associated recordkeeping are delegated to the American Graphic Communication Association (AGCA). A public identifier has the following form:

  reg.type // owner //DTD description // language

These parts have the following meanings:

  reg.type is a plus (+) if the owner is registered according to the ISO 9070 standard. Normally, this will not be the case and so reg.type is a minus (-) sign.
  owner is the name of the owner—your name or your company’s name.
  description is a simple text description. You can make this description as long as you like, but it is a good idea to keep it as short and informative as possible. Spaces are allowed in the description, so you could make it something really meaningful such as Simple Email Message.
  language is the two-character language code taken from the ISO 639 standard.

An example of the public identifier for a DTD developed by me could then be

-//Jim O’Donnell//DTD Simple Web Page//EN

An XML processor attempting to retrieve the DTD’s content may use the public identifier to try to generate a location. This is not always possible, so the public identifier must be followed by a so-called system literal, which is simply a URI. Using the public identifier and the system literal, the documentation type declaration would then look like this:

<!DOCTYPE home.page PUBLIC “-//Jim O’Donnell//DTD Simple Web Page//EN”
“home.dtd”>

Note that before a match is attempted, all strings of whitespace in the public identifier are normalized to single space characters, and leading and trailing whitespace is removed.

Developing the DTD from XML

Many ways exist to describe information models, technically known as schemas. Indeed, several XML development activities are devoted to defining schemas for describing XML data. One such schema is the XML DTD.

The task of developing a DTD can be as simple or as difficult as you make it. It all depends on what you want to do with the information you intend to model with the DTD and what you intend to do with the information after it has been marked up. The easiest, quickest, and simplest method of creating an XML DTD is to start by creating an XML document and working backward.

Identifying Elements

For relatively simple Web pages—and some of the simple applications that we have discussed so far— typing out the intended XML document and then marking it up will most likely give you a flying start on developing your DTD. Before you do, though, make sure that you have a clear idea of what you want to achieve with the DTD. You will learn about this in more detail later in this chapter, but you need to be aware of what kind of markup you want to support. It can be

  Content—Here you are trying to describe what the information means or represents. You would then be looking for abstractions that represent real-world objects, such as part numbers and house addresses.
  Structure—Here you are more concerned with grouping elements such as lists, paragraphs, and tables. These are elements that break the information into units but do not add anything informational.
  Presentation—Here you are concerned only with the way things look and how they are presented when the XML document is displayed.


Avoiding Presentation Markup

As far as generic markup is concerned (and the portability of your XML documents), presentation elements are the worst kind of element and should be avoided as much as possible. Where you feel you need some kind of typographic embellishment, such as boldface, in an XML document, try and relate it to a function by asking yourself why you want it bold in the first place. Is it a keyword? Well, then, call it a KEYWORD element.

Although you should be able to get rid of all the purely presentation elements, inevitably, some will be left. A line break element might be useful, but some of the more familiar candidates that you might think you’d need aren’t worth it. An example of this kind of presentation element is the horizontal line element, HR, in HTML. Yes, you can do some neat things with horizontal lines, but you should be asking yourself where you actually use them. If you can couple a presentation feature to an element, such as putting a horizontal line before the start of a section, or if you can link it to a context, such as indenting paragraphs inside lists, you should think carefully about whether you could achieve the required effect by using a style sheet of some kind.


ON THE WEB
http://www.w3.org/Style/XSL/ This Web site is the home of the work that the World Wide Web Consortium is doing on Extensible Style Sheets (XSL), the companion language to XML meant for describing the presentation format to be used with an XML document.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.