Fixed DOCTYPE parsing to include internal DTD