private static InputSource resolveSchema(final Map<String, String> schemaLocationMap,
      String namespaceUri) throws IOException {
    final EntityResolver2 entityResolver = new CacheXmlParser();

    InputSource inputSource = null;

    // Try loading schema from locations until we find one.
    final String location = schemaLocationMap.get(namespaceUri);

    try {
      inputSource = entityResolver.resolveEntity(null, location);
    } catch (final SAXException e) {
      // ignore
    }

    if (null == inputSource) {
      // Try getting it from the namespace, will throw if does not exist.
      inputSource = new InputSource(new URL(namespaceUri).openStream());
    }

    return inputSource;
  }
Resolve schema from <code>schemaLocationsNape</code> or <code>namespaceUri</code> for given
<code>namespaceUri</code>.

@param schemaLocationMap {@link Map} of namespaceUri to URLs.
@param namespaceUri Namespace URI for schema.
@return {@link InputSource} for schema if found.
@throws IOException if unable to open {@link InputSource}.
@since GemFire 8.1
geode-core/src/main/java/org/apache/geode/management/internal/configuration/domain/CacheElement.java