Skip to main content

Will JAXB2 support XPath

1 reply [Last post]
wangzaixiang
Offline
Joined: 2004-11-24

It would be a good feature if we can using XPath/XQuery on JAXB2 POJO, is there any plan on the idea?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kohsuke
Offline
Joined: 2003-06-09

The specification supports the 'binder', in which JAXB retains association between POJOs and DOM. So you can run XPath on DOM, identify DOM elements, then ask the binder to give you the corresponding Java objects. This is one way to do this.

Some other people in the JAXB users list are investigating the possibility of using JAXB annotations to interpret XPath as object traversal. If you are interested in doing something like this, please join the users list and let's discuss it there.