New to stackoverflow and XML and XSLT. I am receiving external XML feeds which cannot be edited and only transformed for output using XSLT. For example an XML feed could look like:
<competition name="Comp1">
<event name="test1">
<competitor name="competitor1">
<competitor name="competitor2">
<competitor name="competitor3">
</event>
</competition>
and the standard xsl
<xsl:template match="event">
<xsl:attribute name="name"><xsl:value-of select="@name" /></xsl:attribute>
</xsl:template>
will out put the following:
competitor1
competitor2
competitor3
Is there a way to print the name separately? i.e. competitor1 on its own and then where i needed i could print competitor2. is this possible?
My guess would be that i'd have to split up the competitor name but again I can't edit the XML file so not sure what approach to take. And for more bad news, the system that the output is displayed on will not work with html.
Updated
The desired output would be something like:
competitor1 competitor2 competitor3
by doing this i can organize the output the way i need, ie. like above
Really appreciate any help, Thanks in advance