给出这个xml:
var res = orientation(...);
DoAThing(res.heading);
DoAThing(res.pitch);
DoAThing(res.roll);
从<illustratedPartsCatalog>
<figure id="fig1">...</figure>
<catalogSeqNumber>...</catalogSeqNumber>
<figure id="fig2" changeType="delete">...</figure>
<catalogSeqNumber>...</catalogSeqNumber>
<figure id="fig3" changeType="delete">...</figure>
<catalogSeqNumber>...</catalogSeqNumber>
<figure id="fig6">...</figure>
</illustratedPartsCatalog>
是否可以更紧凑地编写以下XPATH?
illustratedPartsCatalog
例如,我尝试了很多变种,但都失败了:
<xsl:if test="figure/@changeType='delete' or descendant::*/@changeType='delete'">
答案 0 :(得分:1)
由于figure
是illustratedPartsCatalog
的后代,你可以写这个......
<xsl:if test="descendant::*/@changeType='delete'">
或者更好的是,这......
<xsl:if test=".//*/@changeType='delete'">