If you attempt to include a schema into one that has a targetNamespace, it fails to correctly resolve the included component. The problem is with line ~420 of XMLCatalogResolver: // The namespace is useful for resolving namespace aware // grammars such as XML schema. Let it take precedence over // the external identifier if one exists. String namespace = resourceIdentifier.getNamespace(); if (namespace != null) { resolvedId = resolveURI(namespace); }
I don't know if this is viable, but this works: // The namespace is useful for resolving namespace aware // grammars such as XML schema. Let it take precedence over // the external identifier if one exists. String namespace = resourceIdentifier.getNamespace(); if (namespace != null) { if (resourceIdentifier instanceof XSDDescription && XSDDescription.CONTEXT_INCLUDE == ((XSDDescription) resourceIdentifier).getContextType()) { resolvedId = resolveSystem(resourceIdentifier.getLiteralSystemId()); } else { resolvedId = resolveURI(namespace); } }
Created attachment 24543 [details] Simple set up with included/imported schemas to illustrate bug.