I have a class with a field which looks like this
@XmlElement(name = "Name", namespace = "a:b:c:1", required = true)
protected String firstName
I want to use JXPath like this
String name = (String) context.getValue("Name");
But it doesn't recognize the XMLElement name attribute. Is there any way to make it do so?
I don't think you can. JXPath allows navigation of bean hierarchies using the standard bean get/is notation, but doesn't provide a means of accessing annotations on a field.
I think you should perhaps look at this answer re. finding annotations. Perhaps you can combine with a JXPath solution ?