相关疑难解决方法(0)

如何使用xpath按文件名查找图像标记

我正在使用水豚运行一些黄瓜功能,我需要检查是否显示某个图像.

我尝试了这个xpath匹配,但显然该功能matches不可用:

//img[matches(@src, "my_image.png")]
Run Code Online (Sandbox Code Playgroud)

xpath cucumber capybara

11
推荐指数
1
解决办法
2万
查看次数

如何在XSL/XPath中按部分名称选择元素?

如何使用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)

regex xml xslt transform

6
推荐指数
1
解决办法
4091
查看次数

标签 统计

capybara ×1

cucumber ×1

regex ×1

transform ×1

xml ×1

xpath ×1

xslt ×1