Help with counting nodes plz

admin

Administrator
Staff member
Hiya All!
I am trying to get a very simple count function to work but cant maybe someone can help

I have a xml page laid out as


<SPEECH>
<SPEAKER>PUCK</SPEAKER>
<LINE>How now, spirit! whither wander you?</LINE>
</SPEECH>


And in my xsl page I been trying stuff like

<xsl:value-of select="count(SPEECH[$speaker]/LINE)" />

and

<xsl:value-of select="count(SPEECH[./SPEAKER[PUCK]]//LINE" />


where $speaker is the variable, which I know does work. Even replacing $speaker with PUCK or
'PUCK' doesn't work. The aim being to return a value of "1", if I were to use the above XML.

This is all being done within a template matching "SCENE", where SCENE is the immediate parent of SPEECH.
Can anyone help? It is only so that I can put it within a choose statement to say that if the line count for a certain speaker is equal to zero, then it will display "Does not appear" in the scene.


Thanks In advance
 
Back
Top