You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by sc...@us.ibm.com on 2002/03/22 02:26:00 UTC

branch merge

I just merged my branch of the redundant expression elimination stuff.

Major architectural changes
1) Rip out cacheing in all iterators, and move the caching into XNodeSet
(actually NodeSequence where the caching is done derives from XObject and
XNodeSet derives from NodeSequence).  Lots of other changes went into this,
including rewriting of some of the xsl:key stuff.

2) Implementation of a Visitor mechanism for the stylesheet and xpath
components.  Each component for an XPath event is passed an
ExpressionOwner, which just has a getExpression and setExpression method,
which allows us to create a list of these, and then be able to do rewrites.
This should be a generally useful mechanism for all sorts of stuff, and
should be considered a public API.

3) Implementation of deepEquality methods for all XPath components, which
allows us to see if two components are equal.

4) Implementation of RedundentExprEliminator, which is a derivative from
the new XSLTVisitor class, which runs over the stylesheet collecting xpaths
within the same scope, and absolute xpaths that are not context dependent.
These are then each reduced by walking the list and checking for deep
equality (though global paths are always reduced).Reduction takes place by
creating variables that have a special namespace and a non-legal local
name.  Both full and partial path reduction done.

Not done yet: Add back in the xsl:key caching that I ripped out (not a big
deal).  Could be skipped, with some risk.

Not done yet: Implement isLast function.  With the new stuff, the last()
function will be slower, so, since most cases are just checking to see if
an item is the last, I want to rewrite foo[last()] patterns to
foo[xalan:isLast()].  Could be skipped, with some risk.

I tried to be as careful with the merge as possible... but I'm sure I
screwed something up, or wiped out some bug fix from the last two months.
If you are running off the main branch, and see a regression of something
that was previously fixed, please let me know ASAP.

-scott