Here is my code:
<xsl:choose>
<xsl:when test="$all_alerts[(g:line_abbr = 'MFL') or (g:line_abbr = 'BSL') or (g:line_abbr = 'CCT') or (g:line_abbr = 'NHSL') and (g:problem != 'normal_service')]">
<b>Subway</b><br /><br />
<xsl:for-each select="$all_alerts[g:line_abbr = 'MFL']">
<xsl:if test="g:problem != 'normal_service'"><xsl:value-of select="g:line"/> | <a href="/m/alert/mfl.html">
<xsl:if test="g:problem = 'station_advisory'">Station Advisory</xsl:if>
<xsl:if test="g:problem = 'stop_advisory'">Stop Advisory</xsl:if>
<xsl:if test="g:problem = 'customer_notice'">Customer Notice</xsl:if>
<xsl:if test="g:problem = 'service_advisory'">Service Advisory</xsl:if>
<xsl:if test="g:problem = 'shuttle_bus'">Shuttle Bus</xsl:if></a><br /><br /></xsl:if>
<xsl:if test="g:problem = 'normal_service'"></xsl:if>
</xsl:for-each>
<xsl:for-each select="$all_alerts[g:line_abbr = 'BSL']">
<xsl:if test="g:problem != 'normal_service'"><xsl:value-of select="g:line"/> | <a href="/m/alert/bsl.html">
<xsl:if test="g:problem = 'station_advisory'">Station Advisory</xsl:if>
<xsl:if test="g:problem = 'stop_advisory'">Stop Advisory</xsl:if>
<xsl:if test="g:problem = 'customer_notice'">Customer Notice</xsl:if>
<xsl:if test="g:problem = 'service_advisory'">Service Advisory</xsl:if>
<xsl:if test="g:problem = 'shuttle_bus'">Shuttle Bus</xsl:if></a><br /><br /></xsl:if>
<xsl:if test="g:problem = 'normal_service'"></xsl:if>
</xsl:for-each>
<xsl:for-each select="$all_alerts[g:line_abbr = 'CCT']">
<xsl:if test="g:problem != 'normal_service'"><xsl:value-of select="g:line"/> | <a href="/m/alert/cct.html">
<xsl:if test="g:problem = 'station_advisory'">Station Advisory</xsl:if>
<xsl:if test="g:problem = 'stop_advisory'">Stop Advisory</xsl:if>
<xsl:if test="g:problem = 'customer_notice'">Customer Notice</xsl:if>
<xsl:if test="g:problem = 'service_advisory'">Service Advisory</xsl:if>
<xsl:if test="g:problem = 'shuttle_bus'">Shuttle Bus</xsl:if></a><br /><br /></xsl:if>
<xsl:if test="g:problem = 'normal_service'"></xsl:if>
</xsl:for-each>
<xsl:for-each select="$all_alerts[g:line_abbr = 'NHSL']">
<xsl:if test="g:problem != 'normal_service'"><xsl:value-of select="g:line"/> | <a href="/m/alert/nhsl.html">
<xsl:if test="g:problem = 'station_advisory'">Station Advisory</xsl:if>
<xsl:if test="g:problem = 'stop_advisory'">Stop Advisory</xsl:if>
<xsl:if test="g:problem = 'customer_notice'">Customer Notice</xsl:if>
<xsl:if test="g:problem = 'service_advisory'">Service Advisory</xsl:if>
<xsl:if test="g:problem = 'shuttle_bus'">Shuttle Bus</xsl:if></a><br /><br /></xsl:if>
<xsl:if test="g:problem = 'normal_service'"></xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
If there are g:line_abbr
that have g:problem != 'normal service'
then I want the title Subway to show as well as the following information, otherwise I want nothing to show at all even the heading of Subway.
The following doesn't hide the title 'Subway' when the for-eachs
are all blank.