Commits

pa...@9ae0c189-cd1f-4510-a509-f4891f5cf20d  committed e47e328

adding recover_silently flag to structerror CVS branch (2nd part)

  • Participants
  • Parent commits a1d0e6f
  • Branches structerror

Comments (0)

Files changed (2)

 sub recover_silently {
     my $self = shift;
     my $arg = shift;
-    (($arg == 1) ? $self->recover(2) : $self->recover($arg)) if ($arg);
+    (($arg == 1) ? $self->recover(2) : $self->recover($arg)) if defined($arg);
     return ($self->recover() == 2) ? 1 : 0;
 }
 

File example/libxml.dkb

             document). The recover mode of XML::LibXML has problems restoring
             documents that are more like well ballanced chunks.</para>
             <para>XML::LibXML will only parse until the first fatal error
-            occours.</para>
+            occours, reporting recoverable parsing errors
+            as warnings. To suppress these warnings use 
+            $parser-&#62;recover_silently(1);
+            or, equivalently, $parser-&#62;recover(2).</para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term>recover_silently</term>
+          <listitem>
+            <funcsynopsis>
+              <funcsynopsisinfo>$parser-&#62;recover_silently(1);</funcsynopsisinfo>
+            </funcsynopsis>
+            <para>Turns the parser warnings off (or on). Defaults to on.</para>
+            <para>This allows to switch off warnings printed to STDERR when
+            parsing documents with recover(1).</para>
+            <para>Please note that calling recover_silently(0) also turns the
+            parser recover mode off and calling recover_silently(1) automatically
+            activates the parser recover mode.</para>
           </listitem>
         </varlistentry>
         <varlistentry>