A man wielding a stolen samurai sword tried to break into Taiwan's presidential palace and wounded a military policeman who stopped him.