xslt change so narrator utterances get distinct styling
get_events.php gets the data for a specified article from the eXist db. It then invokes events.xsl to transform that raw xml to create a new instance of the javascript variable movie and populate it. Here's a snippet from the xsl file that generates the necessary code for an utterance which has a who attribute. The particDesc of that utterer is assumed by this code to contain only a pers and persName element and the text in the persName element.
<xsl:when test="@who">
<!-- get the value of the who attribute, which as a pointer to an id begins with a #, and strip the # -->
<xsl:variable name="utterer" ><xsl:value-of select="translate(@who,'#','')"></xsl:value-of></xsl:variable>
<!-- get the text of the particDesc node (remember to use the tei namespace) whose id matches what's in utterer -->
<!-- this call works down through the pers and persName elements within that particDesc element, there are no other elements or text -->
<!-- for particDesc instances that have more complex internals, I'll need to be more explicit in that particDesc selector -->
<xsl:value-of select="id(@start)/../@xml:id"/>.addEvent('<xsl:value-of
select="id(@start)/@absolute"/>','<xsl:value-of select="id(@end)/@absolute"/>',
'utterance', '<div class="interviewer"><xsl:value-of
select="//tei:particDesc[@xml:id = $utterer]" /> : <xsl:apply-templates/></div>', '<xsl:value-of select="@start"/>');
</xsl:when>
Here's a snippet of the output for two utterances, the first if the who attribute of the utterance is empty and the second if the who attribute of the utterance has a value that points to a particDesc/pers/persName element containing the text "interviewer"
test1t1.addEvent('00:00:00.000','00:00:06.420','utterance', ' text here', 'test1u0');
test1t1.addEvent('00:00:06.420','00:00:18.260','utterance', '<div class="interviewer">interviewer: text here . </div>', 'test1u1');