XML, DTD: how to make the order not important <p>I started off using an XML file and a parser as a convenient way to store my data</p> <p>I want to use DTD to check the structure of the xml files when they arrive.</p> <p>Here is my DTD file </p> <pre><code>&lt; ?xml version="1.0" encoding="UTF-8"?&gt; &lt; !ELEMENT document (level*)&gt; &lt; !ELEMENT level (file,filelName?,fileNumber?)&gt; &lt; !ELEMENT file (#PCDATA)&gt; &lt; !ELEMENT filelName (#PCDATA)&gt; &lt; !ELEMENT fileNumber (#PCDATA)&gt; </code></pre> <p>(note that fileName and fileNumber are actually purely optional)</p> <p>and </p> <pre><code>&lt;document&gt; &lt;level&gt; &lt;file&gt;group1file01&lt;/file&gt; &lt;/level&gt; &lt;level&gt; &lt;file&gt;group1file02&lt;/file&gt; &lt;fileName&gt;file 2&lt;/fileName&gt; &lt;fileNumber&gt;0&lt;/fileNumber&gt; &lt;/level&gt; ... </code></pre> <p>as such all this works fine. (I use eclipse "validate" option to test it for now)</p> <p>however while testing I got what I think is a wierd error</p> <p>if I do </p> <pre><code> &lt;level&gt; &lt;levelName&gt;Level 2&lt;/levelName&gt; &lt;levelNumber&gt;0&lt;/levelNumber&gt; &lt;file&gt;group1level02&lt;/file&gt; &lt;/level&gt; </code></pre> <p>changing the order of the lines, Eclipse refuses to validate it ...</p> <p>I was wondering if this was a problem with Eclipse or if the order is actually important.</p> <p>If the order is important how can I change the DTD to make it work no matter the ordering of he elements?</p> <p>I can't really change the XML because I already have all the XML files and the parser written (I know I did it the wrong way round lol).</p>