Hi
Im new to XSL. Im trying to read a XML file that has identical node names with different values.
<mondial>
<country car_code="MK" capital="cty-cid-cia-Macedonia-Skopje">
<name>Macedonia</name>
<indep_date>1991-09-17</indep_date>
<government>emerging democracy</government>
<encompassed continent="europe" percentage="100"/>
<ethnicgroups percentage="22">Albanian</ethnicgroups>
<ethnicgroups percentage="2">Serb</ethnicgroups>
<ethnicgroups percentage="65">Macedonian</ethnicgroups>
<ethnicgroups percentage="4">Turkish</ethnicgroups>
<ethnicgroups percentage="3">Gypsy</ethnicgroups>
<religions percentage="30">Muslim</religions>
<religions percentage="67">Christian Orthodox</religions>
<languages percentage="21">Albanian</languages>
<languages percentage="70">Macedonian</languages>
<languages percentage="3">Turkish</languages>
<languages percentage="3">Serbian</languages>
<city id="cty-cid-cia-Macedonia-Skopje" country="MK">
<name/>
</city>
</country>
</mondial>
My problem: I am using xsl:for to obtain the ethincgroups. My xsl only grabs the first "ethnicgroups" on the tree. How can I get it to reall all ethnicgroups.
XSL code:
<xsl:key name"eth" match="country" use="ethnicgroups"
<xsl:template match="/"
<xsl:for-each select="//country[generate-id() = generate-id('eth', ethnicgroups)[1]]">
<xsl:value-of select="etnicgroups"
The result I get is Albania. How do I also get Serb, Macedonian, Turkish, Gypsy?