Spanish princess swears allegiance to constitution