GNOME Bugzilla – Bug 341588
Refactoring compilation/transformation
Last modified: 2006-06-19 16:03:53 UTC
This is an anchor for the ChangeLog.
* Enforced stripping of whitespace in some XSLT elements (e.g. xsl:choose) to relax Libxslt's content checks. Stricter checking for elements with an empty content: only whitespace is allowed. This follows the observations and suggestions in: http://mail.gnome.org/archives/xslt/2006-May/msg00044.html * IFDEFed (XSLT_REFACTORED_XSLT_NSCOMP) experimental code which allows for pointer-comparison of the XSLT namespace name (elem->ns->href). * Introduction of an info-struct for literal result elements. Those will be created on demand; i.e., only when the set of effective namespace declarations has changed, there will be created a new info-struct and shared by similar literal result elements. * Computation of the effective namespace declarations of literal result elements at compile-time. - Introduced xsltEffectiveNs * Namespace Aliasing: - Introduced xsltNsAlias - Computed and applied now at compile-time - This modifies the set of effective namespace declarations of literal result elements - node->ns entries are remapped to the target ns-declarations - node->properties->ns are remapped to the target ns-declarations In order to avoid addition of ns-decls to the tree, new ns-decls needed for the ns-aliasing are stored in xmlDoc->oldNs; note that this means that the tree eventually won't be namespace wellformed anymore after compilation. Thus we don't need anymore any ns-aliasing code at transformation-time (removed all ns-aliasing code from namespaces.c). The prefix of the ns-declaration in-scope for @result-prefix will be user rather than the prefix specified in @stylesheet-prefix. * In-scope namespaces are stored in the info-struct; thus we'll be able in the future to use those for execution of XPath expressions (rather than the currently used namespace hash, which needed distinct ns-prefixes in the tree; this restriction will be eliminated in the near future). * Applied the suggestion of Jerome Pesenti: The XPath compilation context (accessible via the compilation context) is now reused for compilation of expressions at compilation-time; this should reduce compilation time to 50% for avarage stylesheets. * Initial rewrite of the sequence-constructor ("template") processing code during transformation; i.e., the instantiation of the "template". * Added commencts here & there