XML DTD parent object same with child object <p>For an example. inside my xml</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;!DOCTYPE expression SYSTEM "task3-1.dtd"&gt; &lt;expression&gt; &lt;left-bracket&gt;(&lt;/left-bracket&gt; &lt;expression&gt; &lt;left-bracket&gt;(&lt;/left-bracket&gt; &lt;expression&gt; &lt;number&gt;24&lt;/number&gt; &lt;operation&gt;+&lt;/operation&gt; &lt;number&gt;24&lt;/number&gt; &lt;/expression&gt; &lt;right-bracket&gt;)&lt;/right-bracket&gt; &lt;operation&gt;*&lt;/operation&gt; &lt;number&gt;5&lt;/number&gt; &lt;/expression&gt; &lt;right-bracket&gt;)&lt;/right-bracket&gt; &lt;operation&gt;-&lt;/operation&gt; &lt;number&gt;6&lt;/number&gt; &lt;/expression&gt; </code></pre> <p>When i try to run the dtd, it's always error that: The element "expression" has invalid child element 'number'. List of possible elements expected: 'left-bracket'</p> <pre><code>&lt;!ELEMENT expression (left-bracket+,right-bracket,operation,number+)&gt; &lt;!ELEMENT left-bracket (#PCDATA)&gt; &lt;!ELEMENT right-bracket (#PCDATA)&gt; &lt;!ELEMENT operation (#PCDATA)&gt; &lt;!ELEMENT number (#PCDATA)&gt; </code></pre>