I tested the code and the open document function works properly. Don't know what's missing, the validation showed even the view.has not been set to HTML tab!