Attributes Entitites   «Prev 

Attribute syntax and usage

General Syntax and DTD Declaration
General Syntax and DTD Declaration

The elementName represents the element for which the attribute (or attribute list) is being defined.
1. The elementName represents the element for which the attribute (or attribute list) is being defined.

The attributeName represents the name of the attribute being declared.
2. The attributeName represents the name of the attribute being declared. Attribute names can contain letters, numbers, dashes, underscores, periods and colons.

The attributeType specifies the kind of attribute this will be. There are eight types you can use when defining attributes; three are commonly used
3. The attributeType specifies the kind of attribute this will be. There are eight types you can use when defining attributes; three are commonly used.

The attributeDefault represents whether the attribute is required (#REQUIRED) or optional (#IMPLIED)
4. The attributeDefault represents whether the attribute is required (#REQUIRED) or optional (#IMPLIED), and whether it has a fixed value (#FIXED value) or a specified default value from an enumerated list.

The ID attribute had to be present and had to be of the ID type.
5. The ID attribute had to be present and had to be of the ID type.

The TYPE attribute was needed because the book would otherwise have been identified internally as having a "Hardcover"
6. The TYPE attribute was needed because the book would otherwise have been identified internally as having a "Hardcover" when in fact it was a "Paperback" type of book.

he STORELOC attribute was optional, and this file would have been valid with or without this attribute/value pair.
7. The STORELOC attribute was optional, and this file would have been valid with or without this attribute/value pair. However, had any value other than "5th Avenue" been specified as the STORELOC attribute's value, this file would have been invalid.

The COMMENT attribute was not required, and no comment was added to the BOOK element.
8. The COMMENT attribute was not required, and no comment was added to the BOOK element.

The value for an ID type attribute cannot begin with a number.
9. The value for an ID type attribute cannot begin with a number. So while ID="1234" is not valid, ID= "A1234" is valid