i am using SAX to parse a huge doc. my Q is: How to set that Validation must occur?
The xerces parser I use seems to be only checking well-formedness, but noth validation ; although I force it to do so:
Approach 1: in the root element of the XML Document. PS:By default the XML Docs I receive do not have either noNamespaceSchemaLocation or schemaLocation set. so I added them manually programmatically just to be able to test; by using reader.set(..., ...);
Approach 2: within the SAX Parser:
PS: THE TARGETNAMESPACE OF THE XSD DOC and the DEFAULT NAMESPACE OF THE RECEIVED Instance XML DOC ARE THE SAME; I guess this means I should NOT use noNamespaceSchemaLocation. Am I right? also, xsi:schemaLocation="http://www.R�STEM.RU/XYZ.KUR file:/C:/schemas/schema1.xsd" this can or cannot exist in the XML Instance document. it should not make any difference. is this also correct? In the Xerces web site, it claims when one programmatically defines the schema location, then the schemaLocation on the XML instance document (if ever exists) will be overwritten..
Originally posted by Lasse Koskela: Have you tried leaving just one (1) space between "http://www.RUSTEM.RU/XYZ.KUR" and "XSDSchemaURI" for the "http://apache.org/xml/properties/schema/external-schemaLocation" property?
Thx, I solved the problem. it was that in the web application I get the location of the XSD File using but the web application context name contained spaces, so it is interpreted as having more than 1 Namespaces and so accompanying schemas...