Attribute Defaults
May 3, 1999
REQUIRED Default
The REQUIRED flag specifies that though there
is no default value provided by the DTD,
the attribute when actually implemented
in an XML document must define a value. For
example, suppose you wanted to define a standard
PAGE_AUTHOR element that
could be added to every page on any site that
used it. Your intent is to
make sure that every author provides contact
information for bugs and broken links.
However, you won't know in advance what
the default values should be because everyone
who implements your DTD will have different
personal information. Thus, you can make the
contact information attributes required,
while not providing defaults.
IMPLIED Default
When you use the IMPLIED default, you will provide
a default value for the document author.
If the document author does not override your
default, your default will be used.
FIXED Default
Sometimes you will want to provide a default value
that the document author may not modify.
In that case, you will use FIXED.
Defining Valid Element Attributes
Introduction to XML For Web Developers | Table of Contents
Attribute Types
|