enhanced to ignore empty text node in xsltDefaultProcessOneNode (avoid
authorWilliam M. Brack <wbrack@src.gnome.org>
Thu, 11 Jan 2007 19:12:45 +0000 (19:12 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Thu, 11 Jan 2007 19:12:45 +0000 (19:12 +0000)
        * libxslt/transform.c: enhanced to ignore empty text node
          in xsltDefaultProcessOneNode (avoid calling xsltCopyText)
          (bug #354900)
        * xsltproc/xsltproc.c: added check for output file problem,
          yielding new error code 11 (Mike Hommey).
        * doc/xsltproc.html, doc/xsltproc.xml: added documentation
          for above, regenerated docs (doc/xlstproc.1)

svn path=/trunk/; revision=1414

ChangeLog
doc/xsltproc.1
doc/xsltproc.html
doc/xsltproc.xml
libxslt/transform.c
xsltproc/xsltproc.c

index 4786125..da0ea32 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Thu Jan 11 11:08:18 PST 2007 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/transform.c: enhanced to ignore empty text node
+         in xsltDefaultProcessOneNode (avoid calling xsltCopyText)
+         (bug #354900)
+       * xsltproc/xsltproc.c: added check for output file problem,
+         yielding new error code 11 (Mike Hommey).
+       * doc/xsltproc.html, doc/xsltproc.xml: added documentation
+         for above, regenerated docs (doc/xlstproc.1)
+
 Wed Jan 10 19:13:08 PST 2007 William Brack <wbrack@mmm.com.hk>
 
        * libexslt/strings.c: added new function 'replace' from Joel
index 2fc14ae..5b5f1a4 100644 (file)
@@ -247,6 +247,9 @@ Internal processing error
 .TP 3n
 \fB10\fR
 Processing was stopped by a terminating message
+.TP 3n
+\fB11\fR
+Could not write the result to the output file
 .SH "SEE ALSO"
 .PP
 \fBlibxml\fR(3),
index 2aafaec..8d19223 100644 (file)
@@ -98,4 +98,4 @@
        </span></dt><dd>Do not apply default attributes from the document's
          <span class="acronym">DTD</span>.
          </dd></dl></div></div><div class="refsect1" lang="en"><a name="return"></a><h2>Return values</h2><p><span class="application">xsltproc</span>'s return codes provide information
-    that can be used when calling it from scripts.</p><p>0: normal</p><p>1: no argument</p><p>2: too many parameters</p><p>3: unknown option</p><p>4: failed to parse the stylesheet</p><p>5: error in the stylesheet</p><p>6: error in one of the documents</p><p>7: unsupported xsl:output method</p><p>8: string parameter contains both quote and double-quotes</p><p>9: internal processing error</p><p>10: processing was stopped by a terminating message</p></div><div class="refsect1" lang="en"><a name="moreinfo"></a><h2>More Information</h2><p><span class="application">libxml web page: </span><a href="http://www.xmlsoft.org/" target="_top">http://www.xmlsoft.org/</a></p><p>W3C <span class="acronym">XSLT page: </span><a href="http://www.w3.org/TR/xslt" target="_top">http://www.w3.org/TR/xslt</a></p></div></div></body></html>
+    that can be used when calling it from scripts.</p><p>0: normal</p><p>1: no argument</p><p>2: too many parameters</p><p>3: unknown option</p><p>4: failed to parse the stylesheet</p><p>5: error in the stylesheet</p><p>6: error in one of the documents</p><p>7: unsupported xsl:output method</p><p>8: string parameter contains both quote and double-quotes</p><p>9: internal processing error</p><p>10: processing was stopped by a terminating message</p><p>11: could not write the result to the output file</p></div><div class="refsect1" lang="en"><a name="moreinfo"></a><h2>More Information</h2><p><span class="application">libxml web page: </span><a href="http://www.xmlsoft.org/" target="_top">http://www.xmlsoft.org/</a></p><p>W3C <span class="acronym">XSLT page: </span><a href="http://www.w3.org/TR/xslt" target="_top">http://www.w3.org/TR/xslt</a></p></div></div></body></html>
index 7e3922c..69e198a 100644 (file)
        </listitem>
                </varlistentry>
 
+               <varlistentry>
+       <term><errorcode>11</errorcode></term>
+       <listitem>
+               <para>Could not write the result to the output file</para>
+       </listitem>
+               </varlistentry>
+
        </variablelist>
 </refsect1>
 
index 14ed772..383c90f 100644 (file)
@@ -1753,6 +1753,7 @@ xsltDefaultProcessOneNode(xsltTransformContextPtr ctxt, xmlNodePtr node,
            if (node->content == NULL) {
                XSLT_TRACE(ctxt,XSLT_TRACE_PROCESS_NODE,xsltGenericDebug(xsltGenericDebugContext,
                 "xsltDefaultProcessOneNode: copy empty text\n"));
+               return;
            } else {
                XSLT_TRACE(ctxt,XSLT_TRACE_PROCESS_NODE,xsltGenericDebug(xsltGenericDebugContext,
                 "xsltDefaultProcessOneNode: copy text %s\n",
index 7f6eeab..ddd98b6 100644 (file)
@@ -456,18 +456,20 @@ xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur, const char *filename) {
 
        xmlFreeDoc(res);
     } else {
-
+        int ret;
        ctxt = xsltNewTransformContext(cur, doc);
        if (ctxt == NULL)
            return;
        if (profile) {
-           xsltRunStylesheetUser(cur, doc, params, output,
+           ret = xsltRunStylesheetUser(cur, doc, params, output,
                                        NULL, NULL, stderr, ctxt);
        } else {
-           xsltRunStylesheetUser(cur, doc, params, output,
+           ret = xsltRunStylesheetUser(cur, doc, params, output,
                                        NULL, NULL, NULL, ctxt);
        }
-       if (ctxt->state == XSLT_STATE_ERROR)
+       if (ret == -1)
+           errorno = 11;
+       else if (ctxt->state == XSLT_STATE_ERROR)
            errorno = 9;
        else if (ctxt->state == XSLT_STATE_STOPPED)
            errorno = 10;