complete cocument parsing