95.7. 在标头上使用 XPath
有些用户可能将 XML 存储在标头中。要将 XPath 应用到标头的值,您可以通过定义 'headerName' 属性来实现此目的。
<xpath headerName="invoiceDetails">/invoice/@orderType = 'premium'</xpath>
<xpath headerName="invoiceDetails">/invoice/@orderType = 'premium'</xpath>
在 Java DSL 中,您可以将 headerName 指定为第 2 个参数,如下所示:
xpath("/invoice/@orderType = 'premium'", "invoiceDetails")
xpath("/invoice/@orderType = 'premium'", "invoiceDetails")