use of org.eclipse.xsd.impl.XSDIncludeImpl in project tmdm-studio-se by Talend.
the class Util method importSchema.
private static void importSchema(XSDSchema xsdSchema, List<XSDImport> imports, Map<String, Integer> schemaMonitor) {
EList<XSDSchemaContent> list = xsdSchema.getContents();
for (XSDSchemaContent schemaCnt : list) {
if (schemaCnt instanceof XSDImport) {
XSDImportImpl xsdImpl = (XSDImportImpl) schemaCnt;
if (xsdImpl.getNamespace() == null || xsdImpl.getNamespace().trim().equals("")) {
// $NON-NLS-1$
URI fileURI = URI.createFileURI(xsdImpl.getSchemaLocation());
// $NON-NLS-1$//$NON-NLS-2$
xsdImpl.setNamespace(fileURI.toFileString().replaceAll("[\\W]", ""));
}
if (xsdImpl.getSchemaLocation() == null) {
continue;
}
((XSDImportImpl) schemaCnt).importSchema();
imports.add(((XSDImportImpl) schemaCnt));
} else if (schemaCnt instanceof XSDInclude) {
XSDIncludeImpl xsdInclude = (XSDIncludeImpl) schemaCnt;
((XSDSchemaImpl) xsdSchema).included(xsdInclude);
}
}
}
Aggregations