[libxslt] Reduce warnings in forwards-compatible mode



commit 92a43f5669437647fb57a6255bbd27e762f3c10a
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Sun Jul 3 14:51:10 2016 +0200

    Reduce warnings in forwards-compatible mode
    
    Don't warn on every unknown element in forwards-compatible mode as
    suggested by François Melchior in bug #677901:
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677901#c3

 libxslt/preproc.c         |    2 +-
 libxslt/xslt.c            |    7 -------
 tests/REC/test-2.5-1.err  |    2 --
 tests/general/bug-175.err |    4 ----
 4 files changed, 1 insertions(+), 14 deletions(-)
---
diff --git a/libxslt/preproc.c b/libxslt/preproc.c
index 955b3b0..ea7a3ee 100644
--- a/libxslt/preproc.c
+++ b/libxslt/preproc.c
@@ -2343,7 +2343,7 @@ xsltStylePreCompute(xsltStylesheetPtr style, xmlNodePtr inst) {
            xsltCheckInstructionElement(style, inst);
            inst->psvi = (void *) xsltDocumentComp(style, inst,
                                (xsltTransformFunction) xsltDocumentElem);
-       } else {
+       } else if ((style == NULL) || (style->forwards_compatible == 0)) {
            xsltTransformError(NULL, style, inst,
                 "xsltStylePreCompute: unknown xsl:%s\n", inst->name);
            if (style != NULL) style->warnings++;
diff --git a/libxslt/xslt.c b/libxslt/xslt.c
index 86feb98..55c7b7e 100644
--- a/libxslt/xslt.c
+++ b/libxslt/xslt.c
@@ -6157,13 +6157,6 @@ xsltParseStylesheetTop(xsltStylesheetPtr style, xmlNodePtr top) {
                        cur->name);
                if (style != NULL) style->errors++;
            }
-           else {
-                /* do Forwards-Compatible Processing */
-               xsltTransformError(NULL, style, cur,
-                       "xsltParseStylesheetTop: ignoring unknown %s element\n",
-                       cur->name);
-               if (style != NULL) style->warnings++;
-            }
        }
        cur = cur->next;
     }
diff --git a/tests/REC/test-2.5-1.err b/tests/REC/test-2.5-1.err
index 70cc3c1..85545ea 100644
--- a/tests/REC/test-2.5-1.err
+++ b/tests/REC/test-2.5-1.err
@@ -1,4 +1,2 @@
 compilation error: file ./test-2.5-1.xsl line 2 element stylesheet
 xsl:version: only 1.0 features are supported
-compilation error: file ./test-2.5-1.xsl line 6 element exciting-new-1.8-feature
-xsltStylePreCompute: unknown xsl:exciting-new-1.8-feature
diff --git a/tests/general/bug-175.err b/tests/general/bug-175.err
index e3ec6fb..aea747a 100644
--- a/tests/general/bug-175.err
+++ b/tests/general/bug-175.err
@@ -1,6 +1,2 @@
 compilation error: file ./bug-175.xsl line 5 element transform
 xsl:version: only 1.0 features are supported
-compilation error: file ./bug-175.xsl line 28 element function
-xsltStylePreCompute: unknown xsl:function
-compilation error: file ./bug-175.xsl line 28 element function
-xsltParseStylesheetTop: ignoring unknown function element


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]