Example 15     <<      >>       intro       contents     

An element can be defined EMPTY. In such a case it can contain only attributes but no text.

  DTD   HOME     

The AAA elements can contain only attributes but no text:

               <!ELEMENT XXX (AAA+)>
               <!ELEMENT AAA EMPTY>
               <!ATTLIST AAA 
                         true ( yes | no ) "yes">
                    
               
            


  Valid documents   HOME     

Both these forms are allowed. In the second case the ending tag must immediately follow the starting one:

               <!DOCTYPE tutorial SYSTEM "tutorial.dtd">

               <XXX>
                    <AAA true="yes"/>
                    <AAA true="no"></AAA>
               </XXX>
               
            

  Documents with errors   HOME     

The AAA element must not contain any text and the starting tag must be immediately closed:

               <!DOCTYPE tutorial SYSTEM "tutorial.dtd">

               <XXX>
                    <AAA true="yes"/>
                    <AAA true="no"></AAA>
                    <AAA>          </AAA>
                    <AAA>Hello!</AAA>
               </XXX>