final XsAnyURI schemaLocation = pInclude.getSchemaLocation();
if (schemaLocation == null) {
throw new LocSAXException("Invalid include: Missing 'schemaLocation' attribute.",
pInclude.getLocator());
}
XsESchema includedSchema = parseSyntax(pLocator, schemaLocation.toString());
XsAnyURI incNamespace = includedSchema.getTargetNamespace();
if (incNamespace == null) {
if (pIncludingSchema.getTargetNamespace() != null) {
includedSchema.setTargetNamespace(pIncludingSchema.getTargetNamespace());
}
} else {
XsAnyURI myNamespace = includedSchema.getTargetNamespace();
if (!incNamespace.equals(myNamespace)) {
throw new LocSAXException("Invalid include: The included schemas target namespace " +
incNamespace + " and the including schemas target namespace " +
myNamespace + " do not match.",
pInclude.getLocator());