onDocumentEnd also receive the complete document
Fixed string parsing