List<Element> fieldEls = evalXPathAsElementList("field", indexEl);
for (Element fieldEl : fieldEls) {
String name = getAttribute(fieldEl, "name", true);
String value = getAttribute(fieldEl, "value", true);
ValueSource source = getEnumAttribute(ValueSource.class, fieldEl, "source", null);
String type = getAttribute(fieldEl, "type", false);
Map<String,String> params = buildParams(fieldEl);
builder.addFieldDefinition(name, value, source, type, params);
}
List<Element> extractEls = evalXPathAsElementList("extract", indexEl);
for (Element extractEl : extractEls) {
String prefix = getAttribute(extractEl, "prefix", false);
String value = getAttribute(extractEl, "value", true);
ValueSource source = getEnumAttribute(ValueSource.class, extractEl, "source", null);
String type = getAttribute(extractEl, "type", false);
Map<String,String> params = buildParams(extractEl);
builder.addDocumentExtractDefinition(prefix, value, source, type, params);
}