I've been MOXy an object mapper that can use XPath to map variables from one object or an XML web service response to another object through annotations.
(https://www.eclipse.org/eclipselink/documentation/2.4/moxy/advanced_concepts005.htm). Here's an example:
@XmlPath("node[@name='first-name']/text()")
private String firstName;
However it doesn't support the xpath 'parent' (EclipseLink MOXy @XmlPath support for axes/parent) or 'child'(eclipselink moxy xpath - selecting all child elements of the current node or all elements in a document with a particular name) checks.
ie: this is an example of what I want to be able to do:
XML:
<Customer>
<Field>
<Type>Code</Type>
<Value>abc</Value>
</Field>
<Field>
<Type>Name</Type>
<Value>cde</Value>
</Field>
...
</Customer>
Java
@XmlPath("Customer/Field[child::Type='Code']/Value/text()")
private String CustomerCode;
Is there a work around to MOXy or add on libraries for parent/child checks?