Hi Rahul, Is it possible to validate the xml instance document, without specifying the schemaLocation attribute at all in the schema instance document?
-----Original Message----- From: Rahul Srivastava [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2001 9:45 PM To: [EMAIL PROTECTED] Subject: Re: specifying schemaLocation attribute in the XML header > From: "abhishekhp" <[EMAIL PROTECTED]> > > Hi, > I am using xerces 1.4.3 to validate xml documents. The following xml > file is to be validated against a schema (say ABC.xsd), ignoring > MSGschema.xsd that is specified in its root attribute (This is achieved > by using the EntityResolver property of the parser). ABC.xsd is derived > from XYZ.xsd. Both, ABC.xsd and XYZ.xsd have their grammars defined in > the namespace http://www.abc.com. Is it possible to validate the > following xml document without specifying the schemaLocation in the xml? If you are using xerces1, you can use the property 'external-schemalocation' to specify ABC.xsd, which will take precedence over schemaLocation attribute in your instance file. Cheers, Rahul. > > <?xml version="1.0" encoding="UTF-8"?> > <MSG xmlns="http://www.abc.com" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.abc.com > http://localhost:7001/XML/MSGschema.xsd"> > <sometag> > ............. > ......... > ........... > </MSG> > > i.e > <?xml version="1.0" encoding="UTF-8"?> > <MSG xmlns="http://www.abc.com" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > <sometag> > ............. > ......... > ........... > </MSG> > > Would the above xml be validated? ?If so, what would be the changes that > are to be made in the parser? > > TIA, > abhishek. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > Sun Microsystems, Inc. --------------------------------------------------------------------- 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]
