Example 8     <<      >>       intro       contents     

Text can be interspersed with elements.

  DTD   HOME     

The element AAA can contain either BBB or CCC. On the other hand the element BBB can contain any combination of text and CCC elements.:

               <!ELEMENT XXX (AAA+ , BBB+)>
               <!ELEMENT AAA (BBB | CCC )>
               <!ELEMENT BBB (#PCDATA | CCC )*>
               <!ELEMENT CCC (#PCDATA)>
               
            


  Valid documents   HOME     

A valid document exploring several possibilities:

               <!DOCTYPE tutorial SYSTEM "tutorial.dtd">

               <XXX>
                    <AAA>
                         <CCC>Precisely one element.</CCC> 
                    </AAA>
                    <AAA>
                         <BBB>
                              <CCC/>
                              <CCC/>
                              <CCC/>
                         </BBB>
                    </AAA>
                    <BBB/>
                    <BBB>
                         This is <CCC/> a combination <CCC/> of <CCC> CCC elements </CCC> and text <CCC/>. 
                    </BBB>
                    <BBB>
                         Text only. 
                    </BBB>
               </XXX>
               
            

  Documents with errors   HOME     

The element AAA cannot contain any text.:

               <!DOCTYPE tutorial SYSTEM "tutorial.dtd">

               <XXX>
                    <AAA>
                         Element: <CCC/>
                    </AAA>
                    <BBB>
                         Element: <CCC/> 
                    </BBB>
               </XXX>