我正在使用水豚运行一些黄瓜功能,我需要检查是否显示某个图像.
我尝试了这个xpath匹配,但显然该功能matches不可用:
//img[matches(@src, "my_image.png")]
Run Code Online (Sandbox Code Playgroud) 如何使用apply-templates仅按名称(非值)选择以特定模式结尾的元素?假设以下xml ...
<report>
<report_item>
<report_created_on/>
<report_cross_ref/>
<monthly_adj/>
<quarterly_adj/>
<ytd_adj/>
</report_item>
<report_item>
....
</report_item>
</report>
Run Code Online (Sandbox Code Playgroud)
我想<xsl:apply-templates>在所有子<report_item>元素以'adj`结尾的实例上使用,因此,在这种情况下,只选择monthly_adj,quaterly_adj和ytd_adj并使用模板.
<xsl:template match="report">
<xsl:apply-templates select="report_item/(elements ending with 'adj')"/>
</xsl:template>
Run Code Online (Sandbox Code Playgroud)