So I was designing an XML file based on a certain DTD. The logic is thus:
Category >> Books(can have many entries) >>Author[required], Price[required], Description, Image)
Here is the DTD generated:
However, I am unable to write a valid XML. I wrote thus:
I get the following error. Any help is appreciated.
C
Category >> Books(can have many entries) >>Author[required], Price[required], Description, Image)
Here is the DTD generated:
<!ELEMENT CATAGORY (PRODUCT+)> <!ELEMENT PRODUCT (NAME,PRICE,DESCRIPTION*,PICTURE*)> <!ATTLIST PRODUCT NAME CDATA #REQUIRED PRICE CDATA #REQUIRED DESCRIPTION CDATA #IMPLIED PICTURE CDATA #IMPLIED CATEGORY (BOOKS|GADGETS|OTHERS) "BOOKS" AUTHOR CDATA #REQUIRED ISBN CDATA #IMPLIED INVENTORY (InStock|Backordered|Discontinued) "InStock">
However, I am unable to write a valid XML. I wrote thus:
<CATAGORY> <PRODUCT NAME="XML BOOK" AUTHOR="XML GENIUS" CATEGORY="BOOKS" DESCRIPTION="BRILLIANT XML BOOK." INVENTORY="InStock" ISBN="653725327" PRICE="36.99" PICTURE=""/> <PRODUCT NAME="XML MASTERS" AUTHOR="XML TEACHER" CATEGORY="BOOKS" DESCRIPTION="" INVENTORY="InStock" ISBN="" PICTURE="" PRICE="23.99"/> </CATAGORY>
I get the following error. Any help is appreciated.
C
ontent model of element <PRODUCT> requires further child elements. Error location: CATAGORY / PRODUCT Details VC: Element Valid (2): Content model of element <PRODUCT> requires further child elements.