GNOME Bugzilla – Bug 339583
Extension elements in the default namespace are not recognized
Last modified: 2006-05-11 20:19:34 UTC
Due to xsltCheckExtPrefix() which performs a lookup for registered extension elements based on namespace *prefixes*, an extension element is not recognized if it has no prefix and is in the default namespace. This is also visible in xsltParseTemplateContent(), where we test if ns != NULL, before we call xsltCheckExtPrefix(): "else if ((cur->ns != NULL) && (style->nsDefs != NULL) && (xsltCheckExtPrefix(style, cur->ns->prefix)))" Example: <?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="urn:test:ext" extension-element-prefixes="#default"> <xsl:template match="/"> <foo/> </xsl:template> </xsl:stylesheet> xsltproc ext-elem.xsl ..\test.xml <?xml version="1.0"?> <foo xmlns="urn:test:ext"/> The extension element "foo" in the stylesheet is not recognized, thus, instead, it is processed as a literal result element. We need to change the semantic of xsltCheckExtPrefix() to perform the lookup based on namespace names and not namespace prefixes. Additionally xsltCheckExtPrefix() needs to work on the set of registered extension element namespaces at the *current* position in the stylesheet's tree. Currently the extension are kind of handled globally.
Fixed in CVS, libxslt/extensions.c, revision 1.42.