This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XSL/XPath expression
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] XSL/XPath expression
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Wed, 16 May 2001 13:21:20 +0100
- References: <819DF5AA819DD11184C300805F664A6603010E75@STSSTOMAIL>
- Reply-To: xsl-list at lists dot mulberrytech dot com
<xsl:template match="ElementList">
<xsl:apply-templates select="Element"/>
</xsl:template>
<xsl:template match="Element">
<xsl:if test="???[@Type='2'][position()=1]">
do something
</xsl:if>
</xsl:template>
either
<xsl:template match="ElementList">
<xsl:apply-templates select="Element"/>
</xsl:template>
<xsl:template match="Element">
<xsl:if test="@Type='2' and not(preceding-sibling::element[@type=2])">
do something
</xsl:if>
</xsl:template>
or
<xsl:template match="Element">
<!-- do nothing -->
</xsl:template>
<xsl:template match="Element[@type=2][position()=1]">
do something
</xsl:template>
or
<xsl:template match="ElementList">
<xsl:apply-templates select="Element[@Type='2'][position()=1]"/>
</xsl:template>
<xsl:template match="Element">
do something
</xsl:template>
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list