*/
private void processNamespaces(PackageType[] packages) {
if (packages.length == 0)
return;
for (int i=0; i<packages.length; i++) {
PackageType temp = packages[i];
PackageTypeChoice choice = temp.getPackageTypeChoice();
if (choice.getNamespace() != null) {
setNamespacePackageMapping(choice.getNamespace(), temp.getName());
}
else if (choice.getSchemaLocation() != null) {
//1--Handle relative locations
String tempLocation = choice.getSchemaLocation();
String currentDir = System.getProperty("user.dir");
currentDir = currentDir.replace('\\', '/');
if (tempLocation.startsWith("./")) {
tempLocation = tempLocation.substring(1);
tempLocation = currentDir+tempLocation;
}
else if (tempLocation.startsWith("../")) {
tempLocation = tempLocation.substring(3);
int lastDir = currentDir.lastIndexOf('/');
currentDir = currentDir.substring(0, lastDir+1);
tempLocation = currentDir + tempLocation;
}
setLocationPackageMapping(tempLocation, temp.getName());
currentDir = null;
tempLocation = null;
}
}
}