protected function getAttributesFromList(
        SimpleXMLElement $element,
        array $attributes,
        bool $ignore_empty = false
    ) : int {
        $count = 0;

        if (count($attributes) > 0) {
            foreach ($attributes as $field => $attr) {
                if (isset($element[$attr])) {
                    $value = (string)$element[$attr];
                    if ($ignore_empty || strlen($value) > 0) {
                        $this->nb_data_object->setValue($field, $value);
                        $count++;
                    }
                }
            }
        }

        return $count;
    }