/** * Returns the namespace URIs found in the given XML file */ public static Set<String> getNamespaces(InputSource source) throws ParserConfigurationException, SAXException, IOException { XmlNamespaceFinder finder = createNamespaceFinder(); Set<String> answer = finder.parseContents(source); if (factory == null) { factory = finder.getFactory(); } return answer; }