Forum Moderators: open
I have an XML feed I'm receiving from another party which contains a list of premiership teams at the top of the document with an assigned id, for example :
<Teams>
<Team id="2" name="Aston Villa" />
<Team id="3" name="Charlton" />
<Team id="4" name="Chelsea" />
...
</Teams>
The Team id's are then referenced throughout the document in relation to fixtures, i.e. 2 v 3.
To reference the teams I'm trying to use a key, however I'm having trouble trying to match the key on an attribute. I've tried numerous variations of the following but none seem to work:
<xsl:key name="teamlist" match="Team/@name" use="Team/@id"/>
If the xml feed was as follows:
<Teams>
<Team id="2">Aston Villa</Team>
<Team id="3">Charlton</Team>
<Team id="4">Chelsea</Team>
</Teams>
Then the following key works fine :
<xsl:key name="teamlist" match="Team" use="@id"/>
However, this is not the case and as the XML feed is generic it can't be amended.
So, in a nutshell my question is, 'is it possible to use an attribute as the pattern match element of a key' and if so how?
Thanks