Adding select...

wxdqz

New Member
This is a simplified version of my xml:
<listing>
<titleList>
<title titleID="someID">
<titleName>Land Of the Dead</titleName>
</title>

<title... etc etc
</titleList>

<eventList>
<event titleID="txsahara" venueID="id01">
<originalTimes>Progs 11.15am 2.15pm 5.15pm</originalTimes>
</event>

<event... etc etc
</eventList>
</listing>


My XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" indent="yes"/>


<xsl:template match="/">
<xsl:apply-templates select="listing/eventList"/>
</xsl:template>


<xsl:template match="eventList">
<ul>
<xsl:apply-templates select="event"/>
</ul>
</xsl:template>


<xsl:template match="event">
<li>
<xsl:value-of select="../../titleList/title[@titleID = current()/@titleID]/titleName"/> - <xsl:value-of select="originalTimes"/>
</li>
</xsl:template>

</xsl:stylesheet>



The xsl displays all the filmtimes in the eventList and links the names to the showtimes, but it shows all filmtimes for all venues. So now I need to filter the list by the venueID, so in an early version I was using <xsl:for-each select="/listing/eventList/event[@venueID='id01']">, but a lots changed, I've tried a lot of different things but figure out how to get it to work.

If someone could amend my code for me I'd be very greatful, I'm not very good at this and I'm just trying to muddle through.

Thanks in advance.
 
Back
Top