It would be a good feature if we can using XPath/XQuery on JAXB2 POJO, is there any plan on the idea?
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.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.