When i'm trying to process data out of an xml file I'm facing this problem: I cant find a way to append the data from the for- each statement.I would like to send them as parameters to the js function.
Here is sample of the xml:
<events>
<event>
<eventType>some type</eventType>
<date>12/24/1999</date>
<participants>
<participant>
<participant_name>Mike</participant_name>
</participant>
<participant>
<participant_name>John</participant_name>
</participant>
</participants>
. . .
and here is the xsl file:
<xsl:for-each select="event">
<tr>
<xsl:variable name="eventType"select="eventType"> </xsl:variable>
<xsl:variable name="date" select="date"></xsl:variable>
<td>
<xsl:value-of select="$eventType" />
</td>
<td>
<xsl:value-of select="$date" />
</td>
<xsl:for-each select="participants/participant">
<td>
<xsl:value-of select="participant_name"/>
</td>
</xsl:for-each>
<td>
<button type="button" onClick="myFunc('{$date} {$eventType}')">
</td>
</tr>
My goal is to create a table when the last column will be a button which sends all the row parameters to js function.The code above is working fine, but I don't seem to find a way to append the participant_name because of its scope. I searched for a solution and didn't find it. hope to find help here, thanks.