Here is a XML snippet:
<div class="headingZoom">
<xsl:text>Congregation Meeting Schedule for </xsl:text>
<xsl:value-of select="MeetingWorkBook/Meeting[1]/MeetingDate/@MonthFull"/>
<xsl:text> </xsl:text>
<xsl:value-of select="MeetingWorkBook/Meeting[1]/MeetingDate/@Year"/>
<xsl:text> - </xsl:text>
<xsl:value-of select="MeetingWorkBook/Meeting[last()]/MeetingDate/@MonthFull"/>
<xsl:text> </xsl:text>
<xsl:value-of select="MeetingWorkBook/Meeting[last()]/MeetingDate/@Year"/>
<xsl:value-of select="MeetingWorkBook/Meeting[last()]/SpecialEvent/Date/@MonthFull"/>
<xsl:text> </xsl:text>
<xsl:value-of select="MeetingWorkBook/Meeting[last()]/SpecialEvent/Date/@Year"/>
</div>
The problem is that the last element will be one or the other:
<xsl:value-of select="MeetingWorkBook/Meeting[last()]/MeetingDate/@MonthFull"/>
<xsl:text> </xsl:text>
<xsl:value-of select="MeetingWorkBook/Meeting[last()]/MeetingDate/@Year"/>
<xsl:value-of select="MeetingWorkBook/Meeting[last()]/SpecialEvent/Date/@MonthFull"/>
<xsl:text> </xsl:text>
<xsl:value-of select="MeetingWorkBook/Meeting[last()]/SpecialEvent/Date/@Year"/>
How can I do that with XSLT-1?
Infact, upon reflection, even this bit needs to apply the same logic where I display the data for Meeting[1]
. It too could be one or the other type of element.
I should point out that it would never have both in teh relevant nodes, just one or the other.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…