Re: [xslt] RE: [xml] does xsltproc caches subexpressions



On Friday 26 May 2006 10:14, Buchcik, Kasimier wrote:
[...]

> > Evaluating this expression starts by asking "[1]" for one
> > item. This in turn asks "bar" for one item, which in turn asks "foo"
>
> for one
>
> > item. So, no more "foo" elements are detected than the first one that
>
> contains
>
> > a bar element.
>
> Ah, this is nice. The machinery is encapsulated in specialized
> iterators, so one don't has to think much when initiating
> the iterations; plus the ability to stop subsequent iterations
> (e.g. if we have a "[1]").

Another great thing is that it goes through everything. For example, 
evaluating fn:insert-before()
(http://www.w3.org/TR/xpath-functions/#func-insert-before) results in a 
specialized iterator being instantiated that takes two other iterators and a 
position. When the InsertionIterator's next() function is called, it simply 
proxies the items from one of the iterators /until/ the position is reached, 
and first then starts evaluating/proxying the other iterator.

[...]

> I'm not sure I understand this correctly: do you mean that
> the iterator still will process all 10000 iterations?

Nope.

> If you say that the RangeIterator will be asked to return
> the last item, then the RangeIterator could just return the
> integer 10000; after all it should be a specilized class for
> ranges.

It would evaluate in constant time, e.g only return the integer of value 
10000. But after a closer look at Saxon, it looks like it doesn't do this 
optimization.

[...]
> > To browse the documentation, run `doxygen` and browse
> > xpath/html/index.html.
> > The classes "Expression" and "Iterator" are central.
>
> Great! Seems like this will become the "standard" open source
> tool for the second generation of XPath/XSLT in the future :-)

I hope it will be conformant. I don't care one dime for products that are fast 
or have fancy features, if they aren't conformant. So, my focus has been on 
getting good regression utilities, documenting the code, clean code, and in 
general keeping it maintainable. Btw, you should check out the cool utilities 
we use:

http://websvn.kde.org/trunk/kdenonbeta/kdom/xpath/kxqts/docs/KXQTSView-mainwindow.png?rev=535935&view=markup


Cheers,

		Frans


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]