我有以下XML:
<FeatureGroup FeatureGroup="Bundesländer">
<Feature>
<FeatureValue>
<Value LanguageCode="fr">Brandenburg</Value>
<Value LanguageCode="de">Brandenburg</Value>
<Value LanguageCode="en">Brandenburg</Value>
</FeatureValue>
</Feature>
</FeatureGroup>
我想用xsl转换它,但是我不能选择featuregroup值“bundesl_nder”。以下是xsl:
<field name="federalState">
<xsl:for-each select="FeatureGroups/FeatureGroup[FeatureGroup = 'Bundesländer']">
<xsl:for-each select="Feature/FeatureValue/Value[@LanguageCode= 'de']">
<xsl:value-of select="." />
</xsl:for-each>
</xsl:for-each>
</field>
如何选择包含元音变调的属性值?
最佳答案
xml和xpath完全支持unicode,因此选择任何unicode字符都不是问题,您只需确保路径选择了@
的属性节点,即用<xsl:for-each select="FeatureGroups/FeatureGroup[FeatureGroup = 'Bundesländer']">
替换<xsl:for-each select="FeatureGroups/FeatureGroup[@FeatureGroup = 'Bundesländer']">
。