Try fgXercesSchemaExternalNoNameSpaceSchemaLocation in place of fgXercesSchemaExternalSchemaLocation. You have to let Xerces know not to associate the schema with a namespace.
-----Original Message----- From: bharath s [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2008 10:59 AM To: [email protected] Subject: Re: SCHEMA Thanks a lot for the link Pelton. But the sample xml file given has xsi:noNamespaceSchemaLocation='personal.xsd' it doesnt hav xsi:schemaLocation as schema file doesnt have any targetNamespace... Is there any feature of DOMBuilder which i have missed out? Im currently doing this: parser->setFeature(XMLUni::fgXercesSchema, true); parser->setFeature(XMLUni::fgDOMValidation, true); parser->setFeature(XMLUni::fgDOMNamespaces, true); parser->setFeature(XMLUni::fgDOMDatatypeNormalization, true); parser->setFeature(XMLUni::fgXercesValidateAnnotations, true); parser->setFeature(XMLUni::fgXercesSkipDTDValidation, true); XMLCh* test=XMLString::transcode("personal.xsd"); parser->setProperty(XMLUni::fgXercesSchemaExternalSchemaLocation,test); parser->setFeature( XMLUni::fgXercesSchemaFullChecking, true); myhandler* errHandler = new myhandler(); parser->setErrorHandler(errHandler);//Set error hadler to our own handler to display appropriate messages char* xmlFile = "personnel.xml"; DOMDocument *doc = 0; try { doc = parser->parseURI(xmlFile);//Parse the xml file into a DOM tree } Thanks in advance, Bharath Shankar. On Mon, Mar 24, 2008 at 5:49 PM, Jesse Pelton <[EMAIL PROTECTED]> wrote: > It looks to me like the error is as reported: your schemaLocation string > does not contain namespace/location URI pairs (separated by spaces). > See http://www.w3.org/TR/xmlschema-0/#ref40. I'd expect validation to > fail if a) there are an odd number of values (as in your example) or b) > one or more values is not a well-formed URI. > > -----Original Message----- > From: bharath s [mailto:[EMAIL PROTECTED] > Sent: Monday, March 24, 2008 6:55 AM > To: [email protected] > Subject: SCHEMA > > Hi all, > > Im trying to validate the sample xml file given with > xerces2.8source..i.e..personnel.xml against the schema > personal.xsd > > Im doing this > > parser->setFeature(XMLUni::fgXercesSchema, true); > parser->setFeature(XMLUni::fgDOMValidation, true); > parser->setFeature(XMLUni::fgDOMNamespaces, true); > parser->setFeature(XMLUni::fgDOMDatatypeNormalization, true); > parser->setFeature(XMLUni::fgXercesValidateAnnotations, true); > parser->setFeature(XMLUni::fgXercesSkipDTDValidation, true); > XMLCh* test=XMLString::transcode("personal.xsd"); > > parser->setProperty(XMLUni::fgXercesSchemaExternalSchemaLocation,test); > parser->setFeature( XMLUni::fgXercesSchemaFullChecking, true); > > myhandler* errHandler = new myhandler(); > parser->setErrorHandler(errHandler);//Set error hadler to our > own > handler to display appropriate messages > char* xmlFile = "personnel.xml"; > DOMDocument *doc = 0; > try { > doc = parser->parseURI(xmlFile);//Parse the xml file into a > DOM > tree > } > > > But the program is giving an error > > The schemaLocation attribute does not contain pairs of values. > At line 4 > At column 50 > terminate called after throwing an instance of > 'xercesc_2_8::DOMException' > Aborted (core dumped) > > > I need some help...Plz... > > > Thanks in advance, > > Bharath Shankar >
