XML DTDLesson 78Free preview
DTD Attributes
This lesson is part of XML · All levels
Summary
The DTD attribute is declared with <!ATTLIST>, complete with the attribute name, its data type, and its presence rules. The presence rule is #REQUIRED (obligatory), #IMPLIED (optional), #FIXED "value" (locked), or value default. Types available include CDATA, ID, IDREF, NMTOKEN, enumeration, as well as entity and notation types.
Key points
- Basic form: <!ATTLIST element attribute rule type>
- #REQUIRED = must be filled; #IMPLIED = may be empty
- "red" = always use that value (#FIXED)
- ID = unique value; IDREF refers to other IDs; IDREFS for many references
- The enumeration limits options such as ("work day" at "weekend")
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.