Bug 48194 - Xml Catalog Resovler fails with included schemas
Summary: Xml Catalog Resovler fails with included schemas
Status: NEW
Alias: None
Product: XmlCommons - Now in JIRA
Classification: Unclassified
Component: Resolver (show other bugs)
Version: 1.x
Hardware: PC Windows Vista
: P2 normal (vote)
Target Milestone: ---
Assignee: Commons Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-13 12:43 UTC by Robert Streich
Modified: 2009-11-20 09:48 UTC (History)
1 user (show)



Attachments
Simple set up with included/imported schemas to illustrate bug. (1.64 KB, application/x-zip-compressed)
2009-11-16 10:13 UTC, Robert Streich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Streich 2009-11-13 12:43:48 UTC
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);
        }
Comment 1 Robert Streich 2009-11-13 14:47:52 UTC
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);
           }
        }
Comment 2 Robert Streich 2009-11-16 10:13:18 UTC
Created attachment 24543 [details]
Simple set up with included/imported schemas to illustrate bug.