java - How to filter xml nodes based on filter in xpath -


i have xml need apply filter filter out nodes. filter criteria sent client via request xml using xpathnotation
ie. objectdata[vdata[@destcode = beanr0170100497]]

when reply client need filter , send above data. can jaxb or other simple parser? sample highly appreciate.

xpath built default api, example...

documentbuilderfactory dbf = documentbuilderfactory.newinstance(); document doc = dbf.newdocumentbuilder().parse(...);  xpathfactory xf = xpathfactory.newinstance(); xpath xpath = xf.newxpath();  string query = ... xpathexpression xexp = xpath.compile(query); nodelist nl = (nodelist) xexp.evaluate(doc, xpathconstants.nodeset); (int index = 0; index < nl.getlength(); index++) {     node node = nl.item(index);     system.out.println(node.gettextcontent()); } 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -