GNOME Bugzilla – Bug 340780
Refactoring stylesheet parsing/compilation
Last modified: 2006-06-26 18:21:02 UTC
This is intended as an anchor for the ChangeLog. I'll try to explain here what has changed so far.
- Fixed bugs which are not IDFEDed out: #340400, #340624
- Fixed bugs which are not IDFEDed out: bug #339576, bug #339570
Changes which are IFDEFed out with XSLT_REFACTORED: * xsl:template: - The xsltTemplate structure was changed to have *const* @name and @nameURI fields: const xmlChar *name; const xmlChar *nameURI; Parsing: - Eliminated superfluous duplication of namespace strings. - template->name and template->nameURI are now put into the string dict - Fixed memory-leak, which occured when the local part of the "name" attribute was not a valid NCName. - Attribute 'mode': added validation of QName's local part. * Preprocessing of stylesheets: - Removal of processing-instruction and comment nodes. - Converting CDATA-sections-nodes to text-nodes. - Merging adjacent text-nodes (only in "strict" mode to retain old behaviour) * It is now an *error* if the "version" attribute is missing on xsl:stylesheet/xsl:transform or the first literal result element of a simplified stylesheet. * It is now *not* an error if there are child-elements of xsl:stylesheet/xsl:transform which are not in the XSLT namespace and are not recognized as registered user-defined data elements. Such elements must still be in a namespace and will be simply ignored. * Minor fixes wrt to incorrect usage of attributes in the XSLT namespace of XSLT elements (not completed yet). * Introduced xsltParseAnyXSLTElem(), xsltParseSequenceConstructor(), etc. to parse the stylesheet and apply content model validation. Note that the previously used backtracking grammar-checks are now eliminated. * xsl:param(s) are now only allowed as immediate children of xsl:template. (well, except for the top-level xsl:param) * Changed handling of exclude-result-prefixes, extension-element-prefixes. * Changed parsing wrt to imports/inclusion: we'll first process all xsl:import and xsl:include instructions to build the import-tree, *then* process all other content of stylesheets in a deep-first order wrt to the import-tree. This way stuff with lower import precedence will be parsed before stuff with higher import precedence. TODO: check if we now can simplify some of the import-precedence-sorting mechanisms, which theoretically need not be performed anymore * Expanded usage of xsltCompilerNodeInfo and the compiler context. * Added comments * Other things I don't remember
- Fixed bugs which are not IDFEDed out: bug #339583