Short answer: no (unless you read in the 2 schema files, and compare them character by character, or some similar ugly approaches). Long answer: there is probably a better way to achieve what you want.
So you want the XML documents to use that one specific schema (or schemas). You can preparse that/those schema(s), store them in a grammar pool, and give that to the parser. This way, your schema will always be used (if the namespaces match), and the schema location attributes in the instance are ignored. If you want to be even safer, you can register an entity resolver, and refuse any request for schemas, if you think the instance doesn't need any more schemas than the ones you preparsed. For information about grammar preparsing and grammar caching using grammar pool, please refer to this faq [1]. [1] http://xml.apache.org/xerces2-j/faq-grammars.html Cheers, Sandy Gao Software Developer, IBM Canada (1-905) 413-3255 [EMAIL PROTECTED] Ron Rothblum/Haifa/IB To: [EMAIL PROTECTED] [EMAIL PROTECTED] cc: Subject: Verifying my schema file 02/05/2003 03:03 AM Please respond to xerces-j-user Is there some way for to check that the schema file that the user specified in the input XML is the one I want him to (preferably a deeper check than just checking the schema filename)? Thanks, Ron. --------------------------------------------------------------------- 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]
