Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTD Well formed file error

Status
Not open for further replies.

dhammy

Programmer
Aug 22, 2001
2
US
Hi. I am a java programmer just learning to write files in xml. I am creating an xml file in my java program. When I go to XMLspy to look at the file, it has the error message that it is not well formed. The code as it looks in xmlspy is below:

<!DOCTYPE ORDER [
<!ELEMENT ORDER (ORDERDETAIL)*>
<!ELEMENT ORDERDETAIL (ORDERID, PRODUCTID, UNITPRICE, QUANTITY, DISCOUNT)>
<!ELEMENT ORDERID (#PCDATA)>
<!ELEMENT PRODUCTID (#PCDATA)>
<!ELEMENT UNITPRICE (#PCDATA)>
<!ELEMENT QUANTITY (#PCDATA)>
<!ELEMENT DISCOUNT (#PCDATA)>
]>


The error message when I try to validate it in xmlspy says it is not well formed and that a <!-- is expected. The cursor is placed after the ]>.

I have spent quite some time trying to figure out what the problem is. I have a very similar file that works just fine and I can't see the difference in the code other than the element names.

Any help is greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top