public XmlSchemaDoc getBestMatch(final String systemId, final String namespaceURI) {
            // Try and find a matching schema by system id.
            List<XmlSchemaDoc> matches = schemaSystemIdMap.get(systemId);
            if (matches != null && matches.size() > 0) {
                return matches.get(0);
            }

            // If not found try and match with namespace URI.
            matches = schemaNamespaceURIMap.get(namespaceURI);
            if (matches != null && matches.size() > 0) {
                return matches.get(0);
            }

            return null;
        }
We will clear the schema cache if there are any changes to the schema.
stroom-pipeline/src/main/java/stroom/pipeline/xmlschema/XmlSchemaCache.java