>> English << | česky | Español | По-русски | Français | Italiano | Deutsch | MagyarZVON > Tutorials > DTD Tutorial
>> Example 14 << | Prev | Next | Contents

Description

If an attribute is implied, a default value can be provided for the case when the attribute is not used.

DTD


Both attributes are implied. Their default value is given.:

<!ELEMENT XXX (AAA+, BBB+)>
<!ELEMENT AAA (#PCDATA)>
<!ELEMENT BBB (#PCDATA)>
<!ATTLIST AAA 
         true ( yes | no ) "yes">
<!ATTLIST BBB 
   month NMTOKEN "1">      
   

Valid documentsTop


The values of true are yes, no and yes. The values of month are 8, 2 and 1.:

 <!DOCTYPE XXX SYSTEM "tutorial.dtd">

<XXX>
   <AAA true="yes"/>
   <AAA true="no"/>
   <AAA/>
   <BBB month="8" />
   <BBB month="2" />
   <BBB/>
</XXX>