RE: Union of StepPattern
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 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[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
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format