What is a Content Model?
What is a DTD?
When getting started with a content management strategy, one of the first things you must do is to choose a content model, or document type definition (DTD). It is important for a company’s documents to follow a specific structure in order to maintain and communicate a consistent, succinct message throughout all of its publications. A DTD defines the content model and the rules of behavior for the set of content. It determines the building blocks, or structure, of an XML document with a list of elements (e.g., paragraph, short description, title, image). It also defines the corresponding attributes, or metadata, that are used to describe each element (e.g., audience, product, platform, language).
This may sound complicated, so let’s take a look at an example that will make the explanation more apparent.
Elements and Rules of Behavior in a DTD
Think about a vehicle production line in a manufacturing environment. In order to make a properly working vehicle, it must contain specific parts, and those parts need to be assembled in a precise way, including:
- One steering wheel
- One engine
- One or more seats (bucket or bench seats)
- Four or more tires
- One back end (trunk, hatchback, or truck bed)
For example: A sedan needs an engine, two bucket seats in the front, a bench seat in the back, four tires, a steering wheel, and a trunk. Likewise, a sports car has the same parts except it has no back seat and it may have a hatchback instead of a trunk. Similarly, a pickup truck requires an engine, a bench seat, four or six tires, a steering wheel, and a truck bed. These vehicles may have a different physical appearance but they all follow a standard set of parts that allow the vehicle to be assembled for proper operation. The vehicle will not operate without these items and therefore, will not be legal for road use (or valid).
Like the vehicles, a document governed by a DTD must contain certain elements (or parts), and those elements must follow specific rules of behavior, for the document to be valid. For example:
- In a vehicle: Engine, steering wheel, tires
- In a publication: Title, paragraph, image
- In a vehicle: A vehicle must have only one steering wheel
- In a publication: A title must have at least one paragraph following it
A DTD describes the elements that can be used in multiple documents and how they should be assembled, similar to the specification that describes a vehicle’s standard parts and how they should be put together.
Attributes in a DTD
In any content model, some elements will have predefined attributes in the DTD. Attributes are simply additional information, or metadata, about those elements. Common attribute names are Product, Audience, and Platform. They contain values that are used for searching, translating, publishing, linking, and navigating content. Going back to our vehicle analogy…
When the vehicles are assembled with their critical parts, the extras and aesthetics are added, such as the paint, the stereo system, and the material for the seats. These extras make the vehicles unique and attractive for different drivers. Some drivers will search for a red sports car with leather seats and a high-end stereo system, while others prefer a blue pickup truck with fabric seats and all-terrain tires. Think how much more difficult it would be to find the perfect new car if you could only search on its essential parts!
Similarly, attributes are like the “extras” of your content. They may describe the products for which your content is relevant, or the audience for whom your content is most appropriate. For example, suppose your company produces a line of printers—Models 100-103—that has very similar features for heavier office productivity. A new line of printers—Models 200-208—has new, sleeker designs for lighter home use. You are responsible for developing content for the user guides for all of these printer models. Using a component content management system (CCMS) and the appropriate content model, you find it most productive to develop reusable content topics since a majority of the instructions for your printers are the same. So, you develop a topic called, “How to Load Paper into the Printer.” However, this topic only applies to the series 100 models that have a large paper tray and not to series 200 models that have a smaller auto sheet feeder, so the Product attribute for this topic would contain values “100, 101, 102, 103”. When a user guide is published for printer model 202, the CCMS evaluates the Product attribute values for “202” and automatically determines that this topic will not be included since it does not have a paper tray. As this example illustrates, attributes make processing and finding content much easier since it further categorizes content beyond the element level.
Validating Content against the DTD
When a vehicle comes off the assembly line, it is inspected to make sure it meets the specifications and safety requirements. XML content must be inspected, too. Once a DTD is created and an XML document is written based on that DTD, the document is then compared to the DTD. If an XML document follows the rules listed in the DTD, then the document is said to be valid. An XML document is considered to be invalid if it does not follow the rules in the corresponding DTD.