Judge in Spain to rule on sex change for minor