code: public static SAXParser newSAXParser(String schemaLanguage, boolean namespaceAware, boolean validating, Source... schemas) throws SAXException, ParserConfigurationException {
          SAXParserFactory factory = SAXParserFactory.newInstance();
          factory.setValidating(validating);
          factory.setNamespaceAware(namespaceAware);
          if (schemas.length != 0) {
              SchemaFactory schemaFactory = SchemaFactory.newInstance(schemaLanguage);
              factory.setSchema(schemaFactory.newSchema(schemas));
          }
          SAXParser saxParser = factory.newSAXParser();
          if (schemas.length == 0) {
              saxParser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", schemaLanguage);
          }
          return saxParser;
      }
docs: Factory method to create a SAXParser configured to validate according to a particular schema language and
  optionally providing the schema sources to validate with.
  
  @param schemaLanguage the schema language used, e.g. XML Schema or RelaxNG (as per the String representation in javax.xml.XMLConstants)
  @param namespaceAware will the parser be namespace aware
  @param validating     will the parser also validate against DTDs
  @param schemas        the schemas to validate against
  @return the created SAXParser
  @throws SAXException
  @throws ParserConfigurationException
  @since 1.8.7