XML DTD elements with the same children

DanielB

New Member
this is getting to my brain so i have a XML doc that has a node called family\[code\]<family> <parents> <name>Bob</name> <init>R</init> <surname>Johnson</surename> </parents> <kids> <name>Lucy</name> <surname>Johnson</surname> </kids></family>\[/code\]the inital is optional so i create the DTD for this it ends up looking like\[code\]<!ELEMENT parent (name, initial?, surname)><!ELEMENT kid (name, initial?, surname)><!ELEMENT name (#PCDATA)><!ELEMENT initial (#PCDATA)><!ELEMENT surname (#PCDATA)><!ELEMENT name (#PCDATA)><!ELEMENT initial (#PCDATA)><!ELEMENT surname (#PCDATA)>\[/code\]but i keep getting this error validity error : Redefinition of element name ^ /tmp/tmp.dtd:26: validity error : Redefinition of element initial ^ /tmp/tmp.dtd:27: validity error : Redefinition of element surname ^even if i change the DTD to look like this.\[code\]<!ELEMENT parent (name, initial?, surname)><!ELEMENT name (#PCDATA)><!ELEMENT initial (#PCDATA)><!ELEMENT surname (#PCDATA)><!ELEMENT kid (name, initial?, surname)><!ELEMENT name (#PCDATA)><!ELEMENT initial (#PCDATA)><!ELEMENT surname (#PCDATA)>\[/code\]same error.. this is literally the second day i am using xml and from the tutorials i have read i cant seem to see what i am doing wrong..
 
Back
Top