summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2002-01-20 13:17:50 +0000
committerDaniel Veillard <veillard@src.gnome.org>2002-01-20 13:17:50 +0000
commit14a94c143867e6225236af640696888b4e98ac89 (patch)
treeb53d03b36f4a3eff30f45a18db7b289c963bd5d9
parent622543d7b3977bd66493fdb17cc7a0e132da5cef (diff)
downloadlibxslt-14a94c143867e6225236af640696888b4e98ac89.tar.gz
libxslt-14a94c143867e6225236af640696888b4e98ac89.tar.bz2
libxslt-14a94c143867e6225236af640696888b4e98ac89.zip
Fixed RH bug #57496, xsltproc was not returning error code on internal
* doc/xsltproc.xml libxslt/xsltutils.c xsltproc/xsltproc.c: Fixed RH bug #57496, xsltproc was not returning error code on internal runtime errors. Should return 9 now. Daniel
-rw-r--r--ChangeLog6
-rw-r--r--doc/xsltproc.xml1
-rw-r--r--libxslt/xsltutils.c2
-rw-r--r--xsltproc/xsltproc.c13
4 files changed, 20 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b7f6f40..2bd736e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun Jan 20 14:15:55 CET 2002 Daniel Veillard <daniel@veillard.com>
+
+ * doc/xsltproc.xml libxslt/xsltutils.c xsltproc/xsltproc.c:
+ Fixed RH bug #57496, xsltproc was not returning error
+ code on internal runtime errors. Should return 9 now.
+
Fri Jan 18 09:43:16 CET 2002 Daniel Veillard <daniel@veillard.com>
* libexslt/math.c: Charlie Bozeman provided the implementation
diff --git a/doc/xsltproc.xml b/doc/xsltproc.xml
index 208ac72b..3106a063 100644
--- a/doc/xsltproc.xml
+++ b/doc/xsltproc.xml
@@ -317,6 +317,7 @@
<para>6: error in one of the documents</para>
<para>7: unsupported xsl:output method</para>
<para>8: string parameter contains both quote and double-quotes</para>
+ <para>9: internal processing error</para>
</refsect1>
diff --git a/libxslt/xsltutils.c b/libxslt/xsltutils.c
index 1280c67a..725729a8 100644
--- a/libxslt/xsltutils.c
+++ b/libxslt/xsltutils.c
@@ -291,6 +291,8 @@ xsltPrintErrorContext(xsltTransformContextPtr ctxt,
const xmlChar *name = NULL;
const char *type = "error";
+ if (ctxt != NULL)
+ ctxt->state = XSLT_STATE_ERROR;
if ((node == NULL) && (ctxt != NULL))
node = ctxt->inst;
diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c
index b6a679c7..7bccc152 100644
--- a/xsltproc/xsltproc.c
+++ b/xsltproc/xsltproc.c
@@ -205,6 +205,7 @@ static void endTimer(char *format, ...)
static void
xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur, const char *filename) {
xmlDocPtr res;
+ xsltTransformContextPtr ctxt;
#ifdef LIBXML_XINCLUDE_ENABLED
if (xinclude) {
@@ -239,11 +240,19 @@ xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur, const char *filename) {
doc = xmlParseFile(filename);
}
}
+ ctxt = xsltNewTransformContext(cur, doc);
+ if (ctxt == NULL)
+ return;
if (profile) {
- res = xsltProfileStylesheet(cur, doc, params, stderr);
+ res = xsltApplyStylesheetUser(cur, doc, params, NULL,
+ stderr, ctxt);
} else {
- res = xsltApplyStylesheet(cur, doc, params);
+ res = xsltApplyStylesheetUser(cur, doc, params, NULL,
+ NULL, ctxt);
}
+ if (ctxt->state == XSLT_STATE_ERROR)
+ errorno = 9;
+ xsltFreeTransformContext(ctxt);
if (timing) {
if (repeat)
endTimer("Applying stylesheet %d times", repeat);