DTD - Notations – Representing Non-XML Data

Introduction

Notations define the format of external data referenced by XML. They tell applications how to interpret non-XML content, such as images, multimedia, or proprietary formats.

Syntax

 
<!NOTATION notationName PUBLIC "publicIdentifier">

Example

Suppose you want to reference a PNG image in XML:

 
<!NOTATION png PUBLIC "image/png"> <!ELEMENT image EMPTY> <!ATTLIST image src CDATA #REQUIRED format NOTATION #REQUIRED>

XML Usage:

 
<image src="logo.png" format="png"/>

Notes

  • Notations do not validate the content; they only declare its type.

  • Often used with external entities to indicate the format.


Summary

  1. Entities – Reusable text or DTD fragments (general vs parameter).

  2. Attributes (ATTLIST) – Metadata for elements with types, defaults, and enumerations.

  3. Notations – Describe non-XML data referenced in documents.

These concepts complement element definitions, sequences, and mixed content, rounding out a deeper understanding of DTD structure and capabilities.