*
* @param doc
* Description of the Parameter
*/
public Configuration parse(Document doc, String configName) {
Configuration configuration = new NestedConfiguration(configName);
String currentCategory;
getBaseConfigName(doc, configuration);
getVariables(doc, configuration);
getIncludeProperties(doc, configuration);
Element root = doc.getDocumentElement();
// first we get all nodes where the element is category
for (Node child = root.getFirstChild(); child != null; child = child
.getNextSibling()) {
if (child.getNodeName().equals("category")) {
NamedNodeMap curAtt = child.getAttributes();
Node curNode = curAtt.getNamedItem("name");
currentCategory = curNode.getNodeValue();
NestedCategory category = new NestedCategory(currentCategory);
getCategory(child, category, configName);
configuration.setCategory(category);
}
}
return configuration;
}