This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: node()[last()] acts a little bit weird in MSXML3?
- To: xsl-list at mulberrytech dot com
- Subject: Re: node()[last()] acts a little bit weird in MSXML3?
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Tue, 27 Jun 2000 17:25:23 +0100 (BST)
- References: <017d01bfe052$72151e70$03c8a8c0@telia.com>
- Reply-To: xsl-list at mulberrytech dot com
> Excerpt from the xsl file:
unfortunately the excerpt os too small to tell what you were trying to
do (but the code probably does something different:-)
I'll assume that in your template for p you have an
<xsl:apply-templates/>
so that at that point a node list of all the child nodes of p will be
created.
... then you have
<xsl:template match="p/node()[last()]">
so this template will only match the last of those nodes.
All the other nodes in the list will have other templates applied, but
you haven't shown the rest if your sheet. They will have the
default template, if you haven't specified any other matching template/
So the earlier nodes will do whatever they do, then on the last node,
this template will be matched.
If the xsl:apply-templates is as I guessed above, with no select
attribute then the last node in the node list will not have any
following siblings so
current()/following-sibling::*
will always be the empty node set (and thus have string value an empty
string)
and
br will have the string value of any br children of the current node.
this is most likely also empty string so this
<xsl:if test="not(current()/following-sibling::*=br)">
is testing if it is not the case that two empty strings are equal.
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list