If there is no data, then there is no end of document, so what do you expect to hide.