* Maybe simply use the dom/sax api?
*/
XSNamespaceItemList namespaces = model.getNamespaceItems();
final URI absolutePath = schema.getAbsoluteFile().toURI();
for (int i = 0; i < namespaces.getLength(); ++i) {
XSNamespaceItem namespace = namespaces.item(i);
StringList documentLocations = namespace.getDocumentLocations();
for (int j = 0; j < documentLocations.getLength(); ++j) {
try {
URI fname = new URI(documentLocations.item(j));
XSModelHelper.logger.debug("Namespace [" + namespace.getSchemaNamespace() + "] file [" + fname + "] absolute path [" + absolutePath + "]");
if (absolutePath.equals(fname)) { return namespace; }
}
catch (URISyntaxException e) {
e.printStackTrace();
XSModelHelper.logger.error("Cannot construct URI from document location [" + documentLocations.item(i) + "] for namespace [" + namespace + "].", e);