Hi I am a new member to this group and also am new to schema validation. I have the following problem in my code.
I am using xerces 2.4 I have attached Test.xml, Product.xsd and XMLTest1.java. The code compiles fine and the SOP of the root element is also displayed fine. But i guess no validation is done because even if i modify the tag names in Test.xml, no error is reported. Please help at the earliest!! Thanks nithya
<?xml version="1.0" encoding="UTF-8"?> <!--Product xmlns="http://www.Bond.com"--> <!--Product--> <Product xmlns="http://www.nith.com"> <!--Product xmlns="http://www.Bond.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="file:///D:/test/xmltest Product.xsd"--> <Books> <Book> <Title>Complete Works</Title> <Author>Shakespeare</Author> <ISBN>0517053616</ISBN> </Book> <Book> <Title>Being Rich is Cool</Title> <Author>Donald Trump</Author> <ISBN>05146553616</ISBN> </Book> </Books> </Product>
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns="http://www.nith.com" targetNamespace="http://www.nith.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified"> <!--xs:include schemaLocation="http://nta2323:8080/DataTypes.xsd"/--> <xs:element name="Product"> <xs:complexType> <xs:sequence> <xs:element name="Books"> <xs:complexType> <xs:sequence maxOccurs="unbounded"> <xs:element name="Book"> <xs:complexType> <xs:sequence> <xs:element name="Title" type="xs:string"/> <xs:element name="Author" type="xs:string"/> <xs:element name="ISBN" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
XMLTest1.java
Description: java/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
