comma separated values in an attribute

wxdqz

New Member
Hi,
Relatively new to XML & XSLT so any help would be greatly appreciated!
I have a program which generates a play-by-play xml file from a football game.

A small excerpt is as follows:

<plays format="summary">
<qtr number="1" text="1st">
<play context="V,1,10,V45" playid="0,1,0" text="AHS wins toss and chooses to receive."></play>
<play context="V,1,10,V45" playid="0,2,1" text="BHS ball on BHS45."></play>
<play context="V,1,10,V45" playid="0,3,2" type="K" text="R. Dugan kickoff 50 yards to the AHS15, out-of-bounds, AHS ball on AHS40."></play>
<drivestart poss="H,H40,15:00" vh="H" spot="H40" clock="15:00" driveindex="1,2"></drivestart>
<play context="H,1,10,H40" playid="1,1,3" type="R" text="M. Smith rush for 3 yards to the AHS43 (M. Fox)."></play>
<play context="H,2,7,H43" playid="1,2,4" type="P" text="C. Brown sacked for loss of 8 yards to the AHS35, fumble by C. Brown recovered by AHS C. Brown at AHS35."></play>
<play context="H,3,15,H35" playid="1,3,5" type="U" text="J. Currie punt 41 yards to the BHS34, out-of-bounds."></play>
<drivesum plays="2" yards="-5" top="1:21" driveindex="1"></drivesum>
<drivestart poss="V,V34,15:00" vh="V" spot="V34" clock="15:00" driveindex="2,5"></drivestart>
</qtr>
</plays>

My issue is with the "context" attribute in each play entry. There's always 4 values separated by commas. Below is a part of my XSL file I've been using to to generate the output:

<xsl:for-each select="plays/qtr">
<xsl:if test="@number='1'">
<xsl:for-each select="play">
<tr>
<td(<xsl:value-of select="@context"/>)<xsl:text> </xsl:text><xsl:value-of select="@text"/></td>
</tr>
</xsl:for-each>
</xsl:if>
</xsl:for-each>

I know...very simple at this point, but ideally I'd like to have the information in the context attribute displayed differently. (i.e. "AHS Ball, 1st and 10 on the AHS 45-yard line.)

Is there any way I can deal with comma separated data inside the context attribute?

Hopefully this makes sense...any help would be great!

Thanks!

BD
 
Back
Top