Andy Black wrote:
> On 11/3/2008 10:26 AM, Hussein Shafie wrote:
>> Andy Black wrote:
>>   
>>> On 11/3/2008 9:20 AM, Hussein Shafie wrote:
>>>     
>> I would replace:
>>
>> id(@foo)/@wiz
>>
>> by something like:
>>
>> //b...@id = current()/@foo]/@wiz
>>
>> That is, get rid of id() by replacing it by a specific XPath.
>>
>> (Just saying that off the top of my head. Didn't test it. However if it
>> works, you should have less performance problems.)
>>   
> 
> Thanks.
> 
> I just tried this and, from what I can tell, it is the same speed or 
> maybe even a bit slower.  It does work, however.
> 

Sorry for what seems to be a bad idea.



> Might it be faster using a custom Java[tm] style sheet extension to do 
> the same kind of thing I'm trying to use id() for?  Or will that also 
> run into the same problem?
> 

A style sheet extension which does the same thing as id() will be as
slow as id(). (You seem to have proven it with
//b...@id = current()/@foo]/@wiz.)

In order to be fast, you need to cache the elements of interest and
therefore, to remove them from the cache when they are modified,
destroyed, etc. Not a simple task.


Reply via email to