RE: [xsl] Union of StepPattern

Subject: RE: [xsl] Union of StepPattern
From: Adam Van Den Hoven <Adam.Hoven@xxxxxxxxxxxx>
Date: Thu, 15 Feb 2001 16:51:25 -0800
Thanks Mike, 

Michael Kay wrote:
> > 	<xsl:template match="DIV[parent::LI]">
> 
> That's fine, though most people write match="LI/DIV" which 
> means the same.

Never let it be said that I do thing in a common way... ;)

Is there any reason to do one over the other? Does one perform better than
the other?

> Technically the value of the variable is a unordered node-set, and the
> filter expression $following-valid[1] selects the node in 
> this node-set that
> comes first in document order. So in effect, yes, you're OK.

So is it always the case then that an unordered list will always be accessed
in document order? One would hope so but can one be sure of it?

> But the "=" test is wrong: it compares the string-values of 
> the nodes, not
> their identity. To compare identity, use 
> generate-id(X)=generate-id(Y), or
> count(X|Y)=1. Except that in this case, I think you can 
> simply say <xsl:if
> test="$following-valid[1][self::DIV]">.

Its certainly more elegant than what I had. Since it produced the same
output, I'll use yours.

Thanks again. It was a great help.
Adam van den Hoven

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


Current Thread