After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 339583 - Extension elements in the default namespace are not recognized
Extension elements in the default namespace are not recognized
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
1.1.15
Other Linux
: Normal normal
: ---
Assigned To: kbuchcik
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-24 15:40 UTC by kbuchcik
Modified: 2006-05-11 20:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description kbuchcik 2006-04-24 15:40:08 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.
Comment 1 kbuchcik 2006-05-11 20:19:34 UTC
Fixed in CVS, libxslt/extensions.c, revision 1.42.