[libxslt] Improve error message in xsltAddTemplate and fix test
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxslt] Improve error message in xsltAddTemplate and fix test
- Date: Fri, 29 Apr 2016 16:09:42 +0000 (UTC)
commit c25610ed523da468b6544e5e95b5bdf2d82722d6
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Fri Apr 29 17:43:35 2016 +0200
Improve error message in xsltAddTemplate and fix test
Minor cleanup after commit aed0cca.
libxslt/pattern.c | 2 +-
tests/REC/test-6.1.err | 2 +-
tests/REC/test-6.1.xml | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libxslt/pattern.c b/libxslt/pattern.c
index 720b0cb..e211a01 100644
--- a/libxslt/pattern.c
+++ b/libxslt/pattern.c
@@ -2104,7 +2104,7 @@ xsltAddTemplate(xsltStylesheetPtr style, xsltTemplatePtr cur,
void *dup = xmlHashLookup2(style->namedTemplates, cur->name,
cur->nameURI);
if (dup != NULL) {
- xsltTransformError(NULL, style, NULL,
+ xsltTransformError(NULL, style, cur->elem,
"xsl:template: error duplicate name '%s'\n",
cur->name);
style->errors++;
diff --git a/tests/REC/test-6.1.err b/tests/REC/test-6.1.err
index 2bf9165..7f0d5b1 100644
--- a/tests/REC/test-6.1.err
+++ b/tests/REC/test-6.1.err
@@ -1,2 +1,2 @@
-compilation error: file test-6.1.xsl line 11 element template
+compilation error: file ./test-6.1.xsl line 11 element template
xsl:template: error duplicate name 'duplicateTemplateName'
diff --git a/tests/REC/test-6.1.out b/tests/REC/test-6.1.out
new file mode 100644
index 0000000..e69de29
diff --git a/tests/REC/test-6.1.xml b/tests/REC/test-6.1.xml
new file mode 100644
index 0000000..69d62f2
--- /dev/null
+++ b/tests/REC/test-6.1.xml
@@ -0,0 +1 @@
+<doc/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]