1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-08-07 10:42:55 +03:00

enhanced to ignore empty text node in xsltDefaultProcessOneNode (avoid

* 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
This commit is contained in:
William M. Brack
2007-01-11 19:12:45 +00:00
parent 40e7c29b35
commit e1b7da0c1f
6 changed files with 28 additions and 5 deletions

View File

@@ -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> Wed Jan 10 19:13:08 PST 2007 William Brack <wbrack@mmm.com.hk>
* libexslt/strings.c: added new function 'replace' from Joel * libexslt/strings.c: added new function 'replace' from Joel

View File

@@ -247,6 +247,9 @@ Internal processing error
.TP 3n .TP 3n
\fB10\fR \fB10\fR
Processing was stopped by a terminating message Processing was stopped by a terminating message
.TP 3n
\fB11\fR
Could not write the result to the output file
.SH "SEE ALSO" .SH "SEE ALSO"
.PP .PP
\fBlibxml\fR(3), \fBlibxml\fR(3),

View File

@@ -98,4 +98,4 @@
</span></dt><dd>Do not apply default attributes from the document's </span></dt><dd>Do not apply default attributes from the document's
<span class="acronym">DTD</span>. <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 </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>

View File

@@ -518,6 +518,13 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><errorcode>11</errorcode></term>
<listitem>
<para>Could not write the result to the output file</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</refsect1> </refsect1>

View File

@@ -1753,6 +1753,7 @@ xsltDefaultProcessOneNode(xsltTransformContextPtr ctxt, xmlNodePtr node,
if (node->content == NULL) { if (node->content == NULL) {
XSLT_TRACE(ctxt,XSLT_TRACE_PROCESS_NODE,xsltGenericDebug(xsltGenericDebugContext, XSLT_TRACE(ctxt,XSLT_TRACE_PROCESS_NODE,xsltGenericDebug(xsltGenericDebugContext,
"xsltDefaultProcessOneNode: copy empty text\n")); "xsltDefaultProcessOneNode: copy empty text\n"));
return;
} else { } else {
XSLT_TRACE(ctxt,XSLT_TRACE_PROCESS_NODE,xsltGenericDebug(xsltGenericDebugContext, XSLT_TRACE(ctxt,XSLT_TRACE_PROCESS_NODE,xsltGenericDebug(xsltGenericDebugContext,
"xsltDefaultProcessOneNode: copy text %s\n", "xsltDefaultProcessOneNode: copy text %s\n",

View File

@@ -456,18 +456,20 @@ xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur, const char *filename) {
xmlFreeDoc(res); xmlFreeDoc(res);
} else { } else {
int ret;
ctxt = xsltNewTransformContext(cur, doc); ctxt = xsltNewTransformContext(cur, doc);
if (ctxt == NULL) if (ctxt == NULL)
return; return;
if (profile) { if (profile) {
xsltRunStylesheetUser(cur, doc, params, output, ret = xsltRunStylesheetUser(cur, doc, params, output,
NULL, NULL, stderr, ctxt); NULL, NULL, stderr, ctxt);
} else { } else {
xsltRunStylesheetUser(cur, doc, params, output, ret = xsltRunStylesheetUser(cur, doc, params, output,
NULL, NULL, NULL, ctxt); NULL, NULL, NULL, ctxt);
} }
if (ctxt->state == XSLT_STATE_ERROR) if (ret == -1)
errorno = 11;
else if (ctxt->state == XSLT_STATE_ERROR)
errorno = 9; errorno = 9;
else if (ctxt->state == XSLT_STATE_STOPPED) else if (ctxt->state == XSLT_STATE_STOPPED)
errorno = 10; errorno = 10;