Isn't it? Maybe that's not what you meant to say, but even now as I re-read your earlier comment I think that's what you said. Based on the downvotes and jimjansen's reply, I'm not alone. jimjansen's reply in fact seems to have taken you to mean that you simply cannot consider someone's experience at all, which is a totally unreasonable position and consistent with your wording. I tried to be more generous in my interpretation but simply can't interpret your earlier comment in way that's consistent with the (correct) idea that one can legally hire Experienced Eric rather than Unemployed Ursula because of his additional experience.
(By the way, unfortunately I think these discrimination laws are basically toothless because in real life there are many factors that legally can be considered, they're all subjective, and employers are under no obligation to explain their reasoning. So you can almost never prove discrimination unless they are dumb enough to tell you about it.)