xsl-list
[Top] [All Lists]

Re: finding the first element of a specific type

2003-05-26 16:56:59
Jon Steeves wrote:
Is there a difference between them -- for example, does one of them take a
couple more processing steps to understand it?

It depends how well the processor optimizes. An XPath starting with "//"
can theoretically search the whole document, which in your case is most
likely a waste. Whether the processor stops at the first matching element
is anyones guess. However, it is likely that the expression is only
evaluated once.
Using the preceding axis will restrict the searched portion of the
document, by definition. However, if the expression is evaluated often
enough there may be no advantage over your solution, even if the processor
optimizes it the obvious way. It all depends on the structure of your XML.

J.Pietschmann


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



<Prev in Thread] Current Thread [Next in Thread>