Subject: Re: [xsl] finding the first element of a specific type|
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Tue, 27 May 2003 01:56:59 +0200
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.