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: node()[last()] acts a little bit weird in MSXML3?



> 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

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