* @throws org.milyn.edisax.EDIConfigurationException is thrown when values are badly formatted.
*/
private void digestSegment(Node node, SegmentGroup segmentGroup, String namespacePrefix, MappingNode parent) throws EDIConfigurationException {
if(segmentGroup instanceof Segment) {
Segment segment = (Segment) segmentGroup;
setValuesForSegment(segment, node, namespacePrefix, parent);
NodeList nodes = node.getChildNodes();
for (int i = 0; i < nodes.getLength(); i++) {
Node currentNode = nodes.item(i);
if (currentNode.getNodeName().equalsIgnoreCase(namespacePrefix + "field")) {
Field field = new Field();
segment.getFields().add(field);
digestField(currentNode, field, namespacePrefix, segment);
} else {
digestSegmentGroup(currentNode, segment.getSegments(), namespacePrefix, segment);
}
}
} else {
segmentGroup.setMaxOccurs(getNodeValueAsInteger(node, "maxOccurs"));
segmentGroup.setMinOccurs(getNodeValueAsInteger(node, "minOccurs"));