Fix for EXSLT func:function
authorNick Wellnhofer <wellnhofer@aevum.de>
Tue, 4 Sep 2012 06:53:14 +0000 (14:53 +0800)
committerDaniel Veillard <veillard@redhat.com>
Tue, 4 Sep 2012 06:53:14 +0000 (14:53 +0800)
For https://bugzilla.gnome.org/show_bug.cgi?id=680920

If the first child of a func:function template is xslt:text, it will be
removed by xsltParseTemplateContent. So xsltParseTemplateContent should
be called before setting func->content to the first child.

libexslt/functions.c

index 4c68cea..e7bb2f1 100644 (file)
@@ -488,6 +488,8 @@ exsltFuncFunctionComp (xsltStylesheetPtr style, xmlNodePtr inst) {
     }
     xmlFree(prefix);
 
+    xsltParseTemplateContent(style, inst);
+
     /*
      * Create function data
      */
@@ -499,8 +501,6 @@ exsltFuncFunctionComp (xsltStylesheetPtr style, xmlNodePtr inst) {
        func->nargs++;
     }
 
-    xsltParseTemplateContent(style, inst);
-
     /*
      * Register the function data such that it can be retrieved
      * by exslFuncFunctionFunction