<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    
    <xsl:template match="/">
        <svg width="500" height="200" version="1.1" xmlns="http://www.w3.org/2000/svg">
            <xsl:apply-templates/>
        </svg>
    </xsl:template>
    
    <xsl:template match="workshop">
        <xsl:variable name="numWorkshop">
            <xsl:number level="any" count="workshop"/>
        </xsl:variable>
        <xsl:variable name="numAttendees">
            <xsl:value-of select="num"/>
        </xsl:variable>
        <xsl:element name="rect">
            <xsl:attribute name="x">80</xsl:attribute>
            <xsl:attribute name="y">
                <xsl:number value="$numWorkshop * 30"/>
            </xsl:attribute>
            <xsl:attribute name="width">
                <xsl:number value="$numAttendees * 5"/>
            </xsl:attribute>
            <xsl:attribute name="height">20</xsl:attribute>
            <xsl:attribute name="style"
                >fill:green;stroke:blue;stroke-width:4;fill-opacity:0.1;stroke-opacity:0.9;opacity:0.9</xsl:attribute>
        </xsl:element>
        
        <xsl:element name="text">
            <xsl:attribute name="x">80</xsl:attribute>
            <xsl:attribute name="y">
                <xsl:number value="($numWorkshop * 30) + 15"/>
            </xsl:attribute>
            <xsl:value-of select="name"/>
        </xsl:element>
        
    </xsl:template>
    
</xsl:stylesheet>

