|
Microsoft Word Applied xml a toolkit for Programmers Wiley docBog'liq Ceponkus, Hoodbhoy - Applied XML - Toolkit for ProgrammersNMTOKENS
default
>
NMTOKENS attribute type. Plural of
NMTOKENS. An element of type
car
has a
hubcap_types
attribute that contains one or
more values, each without white space.
Acceptable XML document entries:
or
format
NOTATION
(automatic|manual)>
NOTATION attribute type. NOTATIONS specify
allowable notations that have been previously
declared (
see NOTATION
section for details).
An element of type
car
has a
transmission_format
attribute that can contain a
notation value of either
automatic
or
manual
.
Note: This is a complete attribute list
declaration—defaults are supplied in the
declaration.
Acceptable XML document entries:
"automatic">
or
"manual">
Unacceptable entry:
- 86 -
"undefined_notation">
Attribute Defaults
The last part of the attribute declaration list is the default value of the attribute. Defaults
come in four variations:
Required.
You must supply a value for the attribute (that is, the document cannot leave
it blank).
Implied.
The parser tells the XML application that no value was supplied, and it is up to
the XML application to decide what value, if any, to fill in.
Fixed.
The values of the attributes are included in the declaration itself. If no value is
supplied, the parser plugs in and passes on the default value. If a value is supplied, it has
to be the same as specified in the declaration or else the parser issues an error.
Supplied.
In this case (the most common), the DTD supplies the default value of the
attribute if it is not supplied in the XML document.
Let’s take a more detailed look at each default type.
|
| |