如果我有以下 XML:
<Results>
<Option isDefault="true" value="1">
<DisplayName>
One
</DisplayName>
</Option>
<Option value="2">
<DisplayName>
Two
</DisplayName>
</Option>
<Option value="3">
<DisplayName>
Three
</DisplayName>
</Option>
</Results>
如何访问value
which Option
has isDefault="true"
?
到目前为止,我已经尝试过:
<xsl:variable name="varName">
<xsl:for-each select="Results/Option[isDefault='true']">
<xsl:value-of select="@value" />
</xsl:for-each>
</xsl:variable>