Thanks Mary. I didn't realise that the 2001 version was mandatory for 1.4.0.
It's now looking like I'm just going to have to wait until the XML (supplied to me from a 3rd party) and all associated schemas are upgraded to the 2001 standard... Guy -----Original Message----- From: Mary Ryan [mailto:[EMAIL PROTECTED] Sent: 22 June 2001 13:13 To: [EMAIL PROTECTED] Subject: Re: Validation problems. With Xerces version 1.4.0, you must use: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" instead of xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" in your XML file, and xmlns='http://www.w3.org/2001/XMLSchema' in your schema file. (Note the "2001" instead of "2000/10"). The next release of XMLSpy should generate the "2001" string. You should also set this additional feature in your code: parser.setFeature("http://apache.org/xml/features/validation/schema",true); Mary Ryan Space Telescope Science Institute ---------------------------------------------------------------------------- ------ "Heathcote, Guy" wrote: > > Hi all. I'm new to this list, so apologies if I'm treading on old > ground.... > > Anyway, I'm attempting to use Xerces-J 1.4.0 in a small application to > undertake a simple validation, but am having problems. To test the > application, I'm using a file that validates correctly using XML Spy, yet > when parsed with Xerces-J, fails with the following errors: > > Error - General Schema Error: Grammar with uri 2: > http://www.ordnancesurvey.co.uk/xml/namespaces/osgb , can not be found. > Error - Element type "osgb:FeatureCollection" must be declared. > Error - General Schema Error: Grammar with uri 2: http://www.opengis.net/gml > , can not be found. > Error - Element type "gml:boundedBy" must be declared. > Error - Element type "gml:null" must be declared. > Error - Element type "osgb:queryTime" must be declared. > . > . > .... etc (continues to list undeclared elements) > > The header of my test file contains: > > <?xml version='1.0' encoding='UTF-8'?> > <osgb:FeatureCollection > xmlns:osgb='http://www.ordnancesurvey.co.uk/xml/namespaces/osgb' > xmlns:gml='http://www.opengis.net/gml' > xmlns:xlink='http://www.w3.org/1999/xlink' > xmlns:xsi='http://www.w3.org/2000/10/XMLSchema-instance' > xsi:schemaLocation='http://www.ordnancesurvey.co.uk/xml/namespaces/osgb > http://www.ordnancesurvey.co.uk/xml/schema/OSDNFFeatures.xsd' > fid='BuiltByGenerator'> > > The code I'm using start the parser is just: > > XMLReader parser = new SAXParser(); > parser.setErrorHandler(errHandler); > parser.setFeature("http://xml.org/sax/features/validation", > true); > parser.setFeature("http://xml.org/sax/features/namespaces", > true); > parser.parse(uri); > > I've tried using the application on both Solaris and PC environments, but > with similar results. Both environments were proved to have active net > connections at the time of the test. Does anyone have any idea about what's > happening here? Why are the namespace definitions not being handled > correctly? > > Thanks in advance. > > Guy Heathcote > Ordnance Survey > > *************************************************************** > For more information on Ordnance Survey products and services, > visit our web site at http://www.ordnancesurvey.co.uk > *************************************************************** > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *************************************************************** This email/attachment(s) has been virus checked upon receipt at the OS and is free of all known viruses. *************************************************************** *************************************************************** For more information on Ordnance Survey products and services, visit our web site at http://www.ordnancesurvey.co.uk *************************************************************** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]