DcatFields dcatFields = new DcatFields();
String schema = xpath.evaluate("@schema", fld);
NodeList flds = (NodeList) xpath.evaluate("field", fld, XPathConstants.NODESET);
for (int i = 0; i < flds.getLength(); i++) {
Node field = flds.item(i);
DcatField df = new DcatField();
String name = xpath.evaluate("@name", field);
df.setName(name);
df.setType(xpath.evaluate("@type", field));
df.setIndex(xpath.evaluate("@index", field));
df.setDateFormat(xpath.evaluate("@dateFormat", field));
String max = Val.chkStr(xpath.evaluate("@maxChars", field));
String required = Val.chkStr(xpath.evaluate("@required", field));
if(required.length() > 0){
df.setRequired(Boolean.parseBoolean(required));
}
if(max.length() > 0){
df.setMaxChars(Integer.parseInt(max));
}
df.setDelimiter(xpath.evaluate("@delimiter", field));
dcatFields.add(df);
}
dcatSchemas.put(schema, dcatFields);
}
}