This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
These example I got from one of the sites and I am trying to validate a xml file using the schema.
But I am getting the following errors. Please let me know where is the error. I am new to xml parsing...
E:\Imp_Exp\Testing>java TestParser personal-schema.xml Inside main method came inside the startDocument method ERROR: line 5: s4s-elt-invalid-content.1: The content of '#AnonType_personnel' i s invalid. Element 'element' is invalid, misplaced, or occurs too often. ERROR: line 11: s4s-elt-invalid-content.1: The content of '#AnonType_person' is invalid. Element 'element' is invalid, misplaced, or occurs too often. came inside the startElement method
a. you need to add xs:sequence after the complextype. b. simpletypes don't need base = 'xs:string' (they are always strings. c. enumeration elements should be in a restriction element. d. ...not sure what else I changed......check the diffs.