[113537] fix problem where physical resolution is performed when not required
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
index 770bc2a..5695926 100644
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
+++ b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
@@ -195,16 +195,20 @@
}
else
{
- ResourceSet resourceSet = new ResourceSetImpl();
- //resourceSet.getAdapterFactories().add(new XSDSchemaLocationResolverAdapterFactory());
- resourceSet.getAdapterFactories().add(new XSDSchemaLocatorAdapterFactory());
-
- URI uri = createURI(uriString);
- XSDResourceImpl resource = (XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd"));
- resource.setURI(uri);
- resource.load(null);
-
- xsdSchema = resource.getSchema();
+ ResourceSet resourceSet = new ResourceSetImpl();
+ //resourceSet.getAdapterFactories().add(new XSDSchemaLocationResolverAdapterFactory());
+ resourceSet.getAdapterFactories().add(new XSDSchemaLocatorAdapterFactory());
+
+ URI uri = createURI(uriString);
+
+ // CS ... ensure we perform physical resolution before opening a stream for the resource
+ //
+ String physicalLocation = URIResolverPlugin.createResolver().resolvePhysicalLocation(uriString, "", uriString);
+ InputStream inputStream = resourceSet.getURIConverter().createInputStream(URI.createURI(physicalLocation));
+ XSDResourceImpl resource = (XSDResourceImpl)resourceSet.createResource(URI.createURI("*.xsd"));
+ resource.setURI(uri);
+ resource.load(inputStream, null);
+ xsdSchema = resource.getSchema();
}
}
catch (Exception e)