*
* @return the generated header
* @throws Exception if generation fails
*/
protected Instances headerFromXML() throws Exception {
Instances result;
Element root;
Element node;
Vector list;
FastVector atts;
Version version;
int[] classIndex;
root = m_Document.getDocumentElement();
// check version
version = new Version();
// if (version.isOlder(root.getAttribute(ATT_VERSION)))
// System.out.println(
// "WARNING: loading data of version " + root.getAttribute(ATT_VERSION)
// + " with version " + Version.VERSION);
// attributes
list = getChildTags(root, TAG_HEADER);
node = (Element) list.get(0);
list = getChildTags(node, TAG_ATTRIBUTES);
node = (Element) list.get(0);
classIndex = new int[1];
atts = createAttributes(node, classIndex);
// generate header
result = new Instances(root.getAttribute(ATT_NAME), atts, 0);
result.setClassIndex(classIndex[0]);
return result;
}