private void importSchema(XsESchema pImportingSchema, String pNamespace,
XsESchema pImportedSchema, Locator pLocator,
String pSchemaLocation)
throws SAXException, ParserConfigurationException, IOException {
XsAnyURI impNamespace = pImportedSchema.getTargetNamespace();
if (pNamespace == null) {
if (impNamespace != null) {
throw new LocSAXException("The 'import' element does not have a 'namespace' attribute, but the imported schema has target namespace " +
impNamespace + ", it ought to match and have none.",
pLocator);
}
} else {
if (impNamespace == null) {
throw new LocSAXException("The 'import' element has a 'namespace' attribute (" + pNamespace +
"), but the imported schema has no 'targetNamespace' attribute.",
pLocator);
} else if (!pNamespace.equals(impNamespace.toString())) {
throw new LocSAXException("The 'import' elements 'namespace' attribute (" + pNamespace +
") and the imported schemas 'targetNamespace' attribute (" +
impNamespace + ") do not match.",
pLocator);
}