added switch viewtype between xml and img