Using the Eclipse link MOXy JAXB implementation, I use the @XmlPath annotation element based on the value of an attribute Attempting to get the value of element I can not seem to work on it Is it supported?
XML Excerpt: POJO quote: What happens now that both values have been assigned to the headrock 2 in succession , As if "Blah" ends with the final value, Bu T itemRef1 never gets a price assigned. I believe the reason for this is that the value portion of XPath expression ([@ id = 'x']) is being ignored. Therefore both XPath expressions are considered equal, and it appears that beforehand ItemRef1 is causing the expression to be mapped, then on ItemRef2, ItemRef2 overwriting item 1 with 1 mapping, ItemRef2 wins < P> I hope this is a sentence on my part due to a constructive issue. Any advice will be appreciated. Thank you, Kevin I lead, and this will be the next XLPS link 2.3 Is part of the release. You can download it from EclipseLink 2.3.0 Night Download (starting on March 22) from today: The mapping bus In the form you are described in your question: For more information
& lt; Items & gt;
...
& lt; ItemRefFields & gt; ;
& lt; ItemRefField id = "1" & gt; 12345 & lt; / ItemRefField & gt;
& lt; ItemRefField id = "2" & gt; Blown & lt; / ItemRefField & gt; ;
& lt; / ItemRefFields & gt;
& lt; / Item & gt;
@XmlAccessorType (XmlAccessType.FIELD)
@XmlRootElement (name = "item")
{ ... ...
@XmlPath ("Motherfuckfield / Motherfuckled [ @ Id = '1'] / text () ") < Private string ItemRef1 = null;
@XmlPath ("ItemRefFields / ItemRefField [@ id = '2'] / text ()")
Private string ItemRef2 = null;
...
}
@XmlAccessorType (XmlAccessType.FIELD) @ XmlRootElement (name = "item") public class item {... @XmlPath ("ItemRefFields / ItemRefField [@ Id = '1'] / text () ") Private string ItemRef1 = null; @ XMLPath ("Motherfuckfield / MotherFuffield [@ id = '2'] / Text ()") Private string item 2 = faucet; ...}
Comments
Post a Comment