diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-12-08 23:46:24 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-12-08 23:46:24 +0000 |
commit | 40a58f49d232694b942b855fd493296a25881f05 (patch) | |
tree | e8cf2c32c197e041088aefb4033f7c2c1b3224d9 /sca-java-2.x/trunk/modules/xsd/src/main/java | |
parent | 9c978d4756b58506f7eb2207d3ef9ce0b2788a7c (diff) |
Update to latest OASIS XSDs
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1043780 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/xsd/src/main/java')
-rw-r--r-- | sca-java-2.x/trunk/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sca-java-2.x/trunk/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java b/sca-java-2.x/trunk/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java index d87f1a3ef1..80bdeb1a41 100644 --- a/sca-java-2.x/trunk/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java +++ b/sca-java-2.x/trunk/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java @@ -24,7 +24,6 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -366,13 +365,20 @@ public class XSDModelResolver implements ModelResolver { return new InputSource(schemaLocation); } } else { - // look to see whether Tuscany has a local version of the - // required schema. It can load the local version rather - // than going out to the network in order to improve performance - url = Constants.CACHED_XSDS.get(targetNamespace); - - if (url == null) { - url = new URL(new URL(baseUri), schemaLocation); + url = new URL(new URL(baseUri), schemaLocation); + String scheme = url.getProtocol(); + if ("file".equalsIgnoreCase(scheme) || "jar".equalsIgnoreCase(scheme) + || "zip".equalsIgnoreCase(scheme) + || "wsjar".equalsIgnoreCase(scheme)) { + // For local URLs, use as-is + } else { + // look to see whether Tuscany has a local version of the + // required schema. It can load the local version rather + // than going out to the network in order to improve performance + URL cached = Constants.CACHED_XSDS.get(targetNamespace); + if (cached != null) { + url = cached; + } } } return XMLDocumentHelper.getInputSource(url); |