From the course: XML Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Declaring attributes

Declaring attributes - XML Tutorial

From the course: XML Essential Training

Start my 1-month free trial

Declaring attributes

- [Speaker] Declaring attributes in a DTD, is accomplished in much the same fashion as declaring elements. All attributes that you are intending to use in a document that is going to be validated by a DTD, have to be declared via an attribute list declaration. An attribute list declaration looks like this. It has an opening angle bracket with an exclamation point, followed by the capital word ATTLIST, and is closed by a closing angle bracket. The element name is the name of the element that you are defining the attributes be used on. The attribute name is the name of the attribute, the type is the attributes type, and I will get to those in a moment, and the default declaration defines how the attribute behaves under default situations, and I will also get to that in a bit. The attribute type can be one of three types. There's the string type, which is indicated by the CDATA keyword, which is all capitals. This means the attribute can be any literal string, and you can just type in…

Contents