XMLPersistenceHelper.checkTag(moduleDescriptionElement, WorkspacePersistenceConstants.MODULE_TAG);
String moduleNameString = moduleDescriptionElement.getAttribute(WorkspacePersistenceConstants.MODULE_NAME_ATTR);
if (moduleNameString.equals("")) {
String errorString = "Could not obtain module from workspace description.";
throw new BadXMLDocumentException(moduleDescriptionElement, errorString);
}
ModuleName moduleName = ModuleName.make(moduleNameString);
List<Element> childElems = XMLPersistenceHelper.getChildElements(moduleDescriptionElement);
int nChildElems = childElems.size();
// Get the vault info element.
Element vaultElement = (nChildElems < 1) ? null : childElems.get(0);
XMLPersistenceHelper.checkIsElement(vaultElement);
// Get the module revision.
Element moduleRevisionElement = (nChildElems < 2) ? null : childElems.get(1);
XMLPersistenceHelper.checkTag(moduleRevisionElement, WorkspacePersistenceConstants.MODULE_REVISION_TAG);
Integer moduleRevisionNum = XMLPersistenceHelper.getElementIntegerValue(moduleRevisionElement);
if (moduleRevisionNum == null) {
throw new BadXMLDocumentException(moduleRevisionElement, "No module revision found.");
}
// Get resource info.
Element revisionInfoElement = (nChildElems < 3) ? null : childElems.get(2);
XMLPersistenceHelper.checkIsElement(revisionInfoElement);