You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Gary L Peskin <ga...@firstech.com> on 2000/11/09 03:58:09 UTC

Changes committed

Scott, Myriam, et al --

I've uploaded my changes to Compiler and the resulting changes caused by
it to WalkerFactory, StepPattern, and TemplateList.

Don't get scared!!  I ran all of the conformance tests with the
pre-change version and the changed version.  All tests remained the same
(except for one which now passes and two which still fail but not as
badly).  Using WinDiff, I compared all of the output files from before
and after the changes.  I also compared the text log files and the XML
logFile.  Except for time differences, they compared byte-for-byte.

I learned a lot more about Xalan in this process and it was very
interesting.

I did uncover a problem in TemplateList.insertAssociationIntoList(). 
Templates are inserted into the appropriate list according to priority
and document order so that the ones with the highest priority appearing
last in the stylesheet appear earlier in the list.  The old code
basically ignored the document order altogether and I've submitted a
conformance test to Shane which fails with the old implementation to
demonstrate this.

However, I just call get getDocOrderPos on the
TemplateSubPatternAssociation item to the document order.  This reveals
the order of the template in the containing stylesheet but not in the
composed stylesheet.  I left a note in the source.  With <xsl:import> it
doesn't matter as much because they're all moved to the top.  But with
stylesheets brought in by <xsl:include>, it can make the difference
between a template being executed (if the <xsl:include> is at the bottom
of the stylesheet) or not (if a later template in the including
stylesheet has the same priority and a compatible match pattern).

I wasn't sure how to solve this problem because I didn't know where, if
anywhere, is kept the location in the including stylesheet where the
included stylesheet fits in.  And I did want to check the code in and
get it off my machine and into the world of being used and banged upon.

If someone knows off the top of his or her head, please let me know and
I'll fix insertAssociationIntoList().  I've commented the code in there
and made it more understandable to someone looking at it, I think,
without sacrificing efficiency (I hope!).  But it's still tricky and
critical that it be right.  So, if you want me to fix it, I will.  In
any event, the code as it sits is no worse than what was there before as
verified by the conformance tests.

Gary