I am new to XML validation.My XSD is\[code\]<xsd:complexType name="RootForm"> <xsd:sequence> <xsd:element name="TRADE" type="RecordForm" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> <xsd:attribute name="ASOF_DATE" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsdattern value="http://stackoverflow.com/questions/12578262/[0-9]{1,2}/[0-9]{1,2}/[0-9]{4}"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="CREATE_DATE" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsdattern value="http://stackoverflow.com/questions/12578262/[0-9]{1,2}/[0-9]{1,2}/[0-9]{4}"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="RECORDS" type="xsd:integer" use="required"/></xsd:complexType>\[/code\]The code that i an running is:\[code\]SAXParserFactory spf = SAXParserFactory.newInstance(); spf.setNamespaceAware(true); spf.setValidating(true); InputSource i = new InputSource("X:/workspace/XMLValidation/src/xml/trades.xml"); InputSource i1 = new InputSource("X:/workspace/XMLValidation/src/xml/transactions.xsd"); SAXParser saxParser = spf.newSAXParser(); saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema"); saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", i1); XMLReader xmlReader = saxParser.getXMLReader(); // xmlReader.setContentHandler(new SimpleErrorHandler()); xmlReader.setErrorHandler(new SimpleErrorHandler()); try { xmlReader.parse(i); } catch (IOException e) { e.printStackTrace(); }\[/code\]I get the below exception:\[code\]src-resolve.4.2: Error resolving component 'RootForm'. It was detected that 'RootForm' is in namespace 'http://www.w3schools.com', but components from this namespace are not referenceable from schema document 'file:///X:/workspace/XMLValidation/src/xml/transactions.xsd'. If this is the incorrect namespace, perhaps the prefix of 'RootForm' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:///X:/workspace/XMLValidation/src/xml/transactions.xsd'. Public ID: null System ID: file:///X:/workspace/XMLValidation/src/xml/transactions.xsd Line number: 6 Column number: 52 Message: src-resolve.4.2: Error resolving component 'RootForm'. It was detected that 'RootForm' is in namespace 'http://www.w3schools.com', but components from this namespace are not referenceable from schema document 'file:///X:/workspace/XMLValidation/src/xml/transactions.xsd'. If this is the incorrect namespace, perhaps the prefix of 'RootForm' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:///X:/workspace/XMLValidation/src/xml/transactions.xsd'.cvc-elt.1: Cannot find the declaration of element 'TRANSACTIONS'.\[/code\]Can any one please help me what i m doing wrong in the xsd fileThanksAvnish