Erwin

Thanks for all your work. It seems like you have gained quite and
insight into the inner workings of XSLTC. Impressive! Please pass me
any diffs you have ('diff -u' is fine with me), and I'll review the
changes and merge them with our current CVS tree.

A few comments:

> * don't give an error for unresolved external functions, instead call a
> new method BasisLibrary.unresolvedExternalF that throws a
> RuntimeException; a good stylesheet uses xsl:if or xsl:choose to check if
> these external functions are available so they don't get called if they
> aren't.

There is already a fix for this in the current CVS tree. I'll run some
extra tests to see if there are some problems still. The compiler will
check if the function-available() call is used and will never compile
calls to any unavailable methods (xsl:if and xsl:choose that test purely
on function-available() will be evaluated at compile-time).

> * Be careful about generated field and method names; any of these
>   characters is not allowed in them: %-.
>   So %rt% becomes $rt$, %as comes $as$ and any names that comes from a
>   stylesheet has - and . converted to $
>   This isn't perfect either, but it makes docbook work without verifier
>   errors.

Good. The '%rt%' method names violate the JVM spec, but is still allowed
by most JVMs, so this has been ignored for a long time.

> * The main applyTemplates method becomes very large (+/- 50 kb). Ideally
>   the method should be split up if it reaches 32 kilobytes, but to make it
>   work now I changed a lot of GOTO's that jump to the or the start end of
>   the main loop to GOTO_W's, and some conditional branches
>   from
>     IFNE long_branch
>   to
>     IFEQ skip_goto
>     GOTO_W long_branch
>     :skip_goto NOP

Very good, and very much needed. We've seen this problem with a few tests.
This is another problem that we've put off for quite a while.

> * Change in XslAttribute; an xsl:attribute is allowed anywhere and adds
>   the attribute to the nearest containing result element. The check in
>   XslAttribute is not needed.

I am not sure if I agree 100% here. Section 7.1.3 of the XSLT 1.0 spec
states that it is an error to add attributes to an element E using the
<xsl:attribute> element after adding child elements to E. Also, there
are cases where some elements created with <xsl:element> are to be
ignored and attributes have to be moved around - but only if they occur
as the first child/children of an element.

> * nwalsh'es stylesheets assume that "document('../common/l10n.xml')"
> is taken relative to the root of the docbook stylesheets, but XSLTC takes
> it relative to the current directory at runtime. I don't know who's right,
> though XSLTC's position seems logical. However to make it work a symlink
> from ../common in your current directory to its real location is
> necessary to make it run.
 
Hmmmm.... this could make a good discussion. Inputs, anyone?

> If you can use patch files, I'll send a tree-diff of all changes in the
> source and in the stylesheets, or otherwise a tar file with a snapshot of
> them.

Sure. Whatever suits.

Thanks,
Morten Jorgensen,
XML Technology Development,
Sun Microsystems, Ireland

Reply via email to