I try to navigate through xml nodes in the reverse direction when I create a subreport but this is not working. My report XPath is /root/parent/child1
and I want a subreport to have /root/parent/child2
as XPath
<root>
<parent>
<child1>
</child1>
<child2>
</child2>
</parent>
</root>
I wrote the following in the data source expression:
((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("//../child2")
My question is a general question about xpath:
Is it allowed to refer ancestors in the datasource expression with ".." or "../.."?