Please look at the following xml and the corrosponding DTD
Using XML Spy: My XML file is well formed but when I validate it against it's corrosponding DTD it gives an error saying: file is not valid Unexpected child element '2'. I don't know what's wrong, is there a problem in the DTD. <0> contains zero or more <1> <2> and <3>. Any help is appreciated. The structure is like:
0
|
--- 1 can repeat
--- 2 can repeat
--- 3 can repeat
|
4
|
9
Thanks
*************** XML file ************
************** Corrosponding DTD ****************
Using XML Spy: My XML file is well formed but when I validate it against it's corrosponding DTD it gives an error saying: file is not valid Unexpected child element '2'. I don't know what's wrong, is there a problem in the DTD. <0> contains zero or more <1> <2> and <3>. Any help is appreciated. The structure is like:
0
|
--- 1 can repeat
--- 2 can repeat
--- 3 can repeat
|
4
|
9
Thanks
*************** XML file ************
Code:
<A>
<0>
<1>1</1>
<1>1</1>
<2>2</2>
<1>1</1>
<1>1</1>
<1>1</1>
<2>2</2>
<1>1</1>
<2>2</2>
<1>1</1>
<1>1</1>
<1>1</1>
<2>2</2>
<3>3</3>
<1>1</1>
<1>1</1>
<2>2</2>
<3>3</3>
</0>
<4>4</4>
<9>9</9>
</A>
************** Corrosponding DTD ****************
Code:
<!ELEMENT A (0?,4?,9?)>
<!ELEMENT 0 (1*)>
<!ELEMENT 1 (TEXT?,2*,3*)>
<!ELEMENT 2 (TEXT?)>
<!ELEMENT 3 (TEXT?)>
<!ELEMENT 4 (TEXT?)>
<!ELEMENT 9 (TEXT?)>
<!ELEMENT TEXT (#PCDATA)>