すべての INST 名をリストする必要がありますが、上記の XML 本体の「inst/idef」部分に「onlyTesters」ノードが存在しない場合のみです。
奇妙なことだとは思いますが、受け取った XML を変更することはできません。
XML:
<river>
<station num="699">
<inst name="FLU(m)" num="1">
<idef></idef>
</inst>
<inst name="Battery(V)" num="18">
<idef>
<onlyTesters/>
</idef>
</inst>
</station>
<INST name="PLU(mm)" num="0" hasData="1" virtual="0"/>
<INST name="FLU(m)" num="1" hasData="1" virtual="0"/>
<INST name="Q(m3/s)" num="3" hasData="1" virtual="1"/>
<INST name="Battery(V)" num="18" hasData="1" virtual="0"/>
</river>
XSL:
<xsl:template match="/">
<xsl:apply-templates select="//INST[@hasData = 1 and not(//inst[@num=(current()/@num)]/idef/onlyTesters)]/@name"/>
</xsl:template>
<xsl:template match="//INST[@hasData = 1 and not(//inst[@num=(current()/@num)]/idef/onlyTesters)]/@name">
<xsl:value-of select="@name"/>,
</xsl:template>
私は一致していません。
これは私が期待する結果です:
PLU(mm),FLU(m),Q(m3/s)