This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Is this a legal XPath Expression?


> Subject: [xsl] Is this a legal XPath Expression?

> select=".[not(.=preceding::TR/TD[15]/node())]"
>

No, it isn't legal. "." is an AbbreviatedStep, as such it is a Step, and a
Step cannot be followed by a Predicate.

Write select="self::node()[not(.=preceding::TR/TD[15]/node())]"

Or in the context where you are using it,

<xsl:template match="TR/TD[15]">
		<xsl:variable name="subject"
                           select="not(.=preceding::TR/TD[15]/node())"/>
		<xsl:if test="$subject">
		<tr>
			<td>
				<a href="{.}.html"><xsl:value-of select="."/></a>
			</td>
		</tr>
		</xsl:if>
</xsl:template>

I'm suspicious about that TR[15]/node() as well: what if it's a comment?

Mike Kay
Software AG


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]