}
//get the tool elements
List<Element> toolElements = element.getChildren("tool",ns);
for(Element toolElement : toolElements) {
ToolInfo toolInfo = new ToolInfo();
Attribute toolNameAttr = toolElement.getAttribute("toolname");
Attribute toolVersionAttr = toolElement.getAttribute("toolversion");
if(toolNameAttr != null) {
toolInfo.setName(toolNameAttr.getValue());
}
if(toolVersionAttr != null) {
toolInfo.setVersion(toolVersionAttr.getValue());
}
fileIdentSect.addReportingTool(toolInfo);
}
//get the version elements
List<Element> versionElements = element.getChildren("version",ns);
for(Element versionElement : versionElements) {
ToolInfo toolInfo = new ToolInfo();
Attribute toolNameAttr = versionElement.getAttribute("toolname");
Attribute toolVersionAttr = versionElement.getAttribute("toolversion");
if(toolNameAttr != null) {
toolInfo.setName(toolNameAttr.getValue());
}
if(toolVersionAttr != null) {
toolInfo.setVersion(toolVersionAttr.getValue());
}
String value = versionElement.getText();
FormatVersion formatVersion = new FormatVersion(value,toolInfo);
fileIdentSect.addFormatVersion(formatVersion);
}
//get the externalIdentifier elements
List<Element> xIDElements = element.getChildren("externalIdentifier",ns);
for(Element xIDElement : xIDElements) {
String type = xIDElement.getAttributeValue("type");
String value = xIDElement.getText();
ToolInfo toolInfo = new ToolInfo();
Attribute toolNameAttr = xIDElement.getAttribute("toolname");
Attribute toolVersionAttr = xIDElement.getAttribute("toolversion");
if(toolNameAttr != null) {
toolInfo.setName(toolNameAttr.getValue());
}
if(toolVersionAttr != null) {
toolInfo.setVersion(toolVersionAttr.getValue());
}
ExternalIdentifier xid = new ExternalIdentifier(type,value,toolInfo);
fileIdentSect.addExternalID(xid);
}
identities.add(fileIdentSect);