protected function setOriginalName(\databox $databox, array $record)
    {
        static $stmt;

        if (!isset($stmt[$databox->get_sbas_id()])) {
            $sql = 'UPDATE record SET originalname = :originalname WHERE record_id = :record_id';
            $stmt[$databox->get_sbas_id()] = $databox->get_connection()->prepare($sql);
        }

        $original = '';

        if (false !== $sxe = simplexml_load_string($record['xml'])) {
            foreach ($sxe->doc->attributes() as $key => $value) {
                if (trim($key) != 'originalname') {
                    continue;
                }
                $original = basename(trim($value));
                break;
            }
        }

        $stmt[$databox->get_sbas_id()]->execute([':originalname' => $original, ':record_id'    => $record['record_id']]);
    }