【发布时间】:2018-10-08 09:03:16
【问题描述】:
我在创建子报表时尝试反向浏览 xml 节点,但这不起作用。我的报告 XPath 是 /root/parent/child1,我希望子报告将 /root/parent/child2 作为 XPath
<root>
<parent>
<child1>
</child1>
<child2>
</child2>
</parent>
</root>
我在数据源表达式中写了以下内容:
((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("//../child2")
我的问题是关于 xpath 的一般问题:
是否允许在数据源表达式中使用“..”或“../..”来引用祖先?
【问题讨论】:
标签: xml xpath jasper-reports xmldatasource