Commits

Shlomi Fish committed 71b1497

Convert lib/XML/LibXML/Error.pm from tabs to spaces.

Comments (0)

Files changed (1)

lib/XML/LibXML/Error.pm

 $WARNINGS = 0; # 0: supress, 1: report via warn, 2: report via die
 $VERSION = "1.73"; # VERSION TEMPLATE: DO NOT CHANGE
 
-use constant XML_ERR_NONE	     => 0;
-use constant XML_ERR_WARNING	     => 1; # A simple warning
-use constant XML_ERR_ERROR	     => 2; # A recoverable error
-use constant XML_ERR_FATAL	     => 3; # A fatal error
+use constant XML_ERR_NONE            => 0;
+use constant XML_ERR_WARNING         => 1; # A simple warning
+use constant XML_ERR_ERROR           => 2; # A recoverable error
+use constant XML_ERR_FATAL           => 3; # A fatal error
 
-use constant XML_ERR_FROM_NONE	     => 0;
+use constant XML_ERR_FROM_NONE       => 0;
 use constant XML_ERR_FROM_PARSER     => 1; # The XML parser
-use constant XML_ERR_FROM_TREE	     => 2; # The tree module
+use constant XML_ERR_FROM_TREE       => 2; # The tree module
 use constant XML_ERR_FROM_NAMESPACE  => 3; # The XML Namespace module
-use constant XML_ERR_FROM_DTD	     => 4; # The XML DTD validation
-use constant XML_ERR_FROM_HTML	     => 5; # The HTML parser
+use constant XML_ERR_FROM_DTD        => 4; # The XML DTD validation
+use constant XML_ERR_FROM_HTML       => 5; # The HTML parser
 use constant XML_ERR_FROM_MEMORY     => 6; # The memory allocator
 use constant XML_ERR_FROM_OUTPUT     => 7; # The serialization code
-use constant XML_ERR_FROM_IO	     => 8; # The Input/Output stack
-use constant XML_ERR_FROM_FTP	     => 9; # The FTP module
-use constant XML_ERR_FROM_HTTP	     => 10; # The FTP module
+use constant XML_ERR_FROM_IO         => 8; # The Input/Output stack
+use constant XML_ERR_FROM_FTP        => 9; # The FTP module
+use constant XML_ERR_FROM_HTTP       => 10; # The FTP module
 use constant XML_ERR_FROM_XINCLUDE   => 11; # The XInclude processing
-use constant XML_ERR_FROM_XPATH	     => 12; # The XPath module
+use constant XML_ERR_FROM_XPATH      => 12; # The XPath module
 use constant XML_ERR_FROM_XPOINTER   => 13; # The XPointer module
-use constant XML_ERR_FROM_REGEXP     => 14;	# The regular expressions module
+use constant XML_ERR_FROM_REGEXP     => 14;     # The regular expressions module
 use constant XML_ERR_FROM_DATATYPE   => 15; # The W3C XML Schemas Datatype module
 use constant XML_ERR_FROM_SCHEMASP   => 16; # The W3C XML Schemas parser module
 use constant XML_ERR_FROM_SCHEMASV   => 17; # The W3C XML Schemas validation module
 use constant XML_ERR_FROM_RELAXNGP   => 18; # The Relax-NG parser module
 use constant XML_ERR_FROM_RELAXNGV   => 19; # The Relax-NG validator module
 use constant XML_ERR_FROM_CATALOG    => 20; # The Catalog module
-use constant XML_ERR_FROM_C14N	     => 21; # The Canonicalization module
-use constant XML_ERR_FROM_XSLT	     => 22; # The XSLT engine from libxslt
-use constant XML_ERR_FROM_VALID	     => 23; # The DTD validation module with valid context
-use constant XML_ERR_FROM_CHECK	     => 24; # The error-checking module
+use constant XML_ERR_FROM_C14N       => 21; # The Canonicalization module
+use constant XML_ERR_FROM_XSLT       => 22; # The XSLT engine from libxslt
+use constant XML_ERR_FROM_VALID      => 23; # The DTD validation module with valid context
+use constant XML_ERR_FROM_CHECK      => 24; # The error-checking module
 use constant XML_ERR_FROM_WRITER     => 25; # The xmlwriter module
 use constant XML_ERR_FROM_MODULE     => 26; # The dynamically-loaded module module
-use constant XML_ERR_FROM_I18N	     => 27; # The module handling character conversion
+use constant XML_ERR_FROM_I18N       => 27; # The module handling character conversion
 use constant XML_ERR_FROM_SCHEMATRONV=> 28; # The Schematron validator module
 
 @error_domains = ("", "parser", "tree", "namespace", "validity",
-		  "HTML parser", "memory", "output", "I/O", "ftp",
-		  "http", "XInclude", "XPath", "xpointer", "regexp",
-		  "Schemas datatype", "Schemas parser", "Schemas validity", 
-		  "Relax-NG parser", "Relax-NG validity",
-		  "Catalog", "C14N", "XSLT", "validity", "error-checking",
-		  "xmlwriter", "dynamic loading", "i18n",
-		  "Schematron validity");
+                  "HTML parser", "memory", "output", "I/O", "ftp",
+                  "http", "XInclude", "XPath", "xpointer", "regexp",
+                  "Schemas datatype", "Schemas parser", "Schemas validity", 
+                  "Relax-NG parser", "Relax-NG validity",
+                  "Catalog", "C14N", "XSLT", "validity", "error-checking",
+                  "xmlwriter", "dynamic loading", "i18n",
+                  "Schematron validity");
 
 for my $field (qw<code _prev level file line nodename message column context
                   str1 str2 str3 num1 num2>) {
     if (ref($xE)) {
       my ($context,$column) = $xE->context_and_column();
       $terr =bless {
-	domain  => $xE->domain(),
-	level   => $xE->level(),
-	code    => $xE->code(),
-	message => $xE->message(),
-	file    => $xE->file(),
-	line    => $xE->line(),
-	str1    => $xE->str1(),
-	str2    => $xE->str2(),
-	str3    => $xE->str3(),
-	num1    => $xE->num1(),
-	num2    => $xE->num2(),
-	(defined($context) ?
-	   (
-	     context => $context,
-	     column => $column,
-	    ) : ()),
+        domain  => $xE->domain(),
+        level   => $xE->level(),
+        code    => $xE->code(),
+        message => $xE->message(),
+        file    => $xE->file(),
+        line    => $xE->line(),
+        str1    => $xE->str1(),
+        str2    => $xE->str2(),
+        str3    => $xE->str3(),
+        num1    => $xE->num1(),
+        num2    => $xE->num2(),
+        (defined($context) ?
+           (
+             context => $context,
+             column => $column,
+            ) : ()),
       }, $class;
     } else {
       # !!!! problem : got a flat error
       # warn("PROBLEM: GOT A FLAT ERROR $xE\n");
       $terr =bless {
-	domain  => 0,
-	level   => 2,
-	code    => -1,
-	message => $xE,
-	file    => undef,
-	line    => undef,
-	str1    => undef,
-	str2    => undef,
-	str3    => undef,
-	num1    => undef,
-	num2    => undef,
+        domain  => 0,
+        level   => 2,
+        code    => -1,
+        message => $xE,
+        file    => undef,
+        line    => undef,
+        str1    => undef,
+        str2    => undef,
+        str3    => undef,
+        num1    => undef,
+        num2    => undef,
       }, $class;
     }
     return $terr;
       my $terr;
       $terr=XML::LibXML::Error->new($xE);
       if ($terr->{level} == XML_ERR_WARNING and $WARNINGS!=2) {
-	warn $terr if $WARNINGS;
-	return $prev;
+        warn $terr if $WARNINGS;
+        return $prev;
       }
       #unless ( defined $terr->{file} and length $terr->{file} ) {
-	# this would make it easier to recognize parsed strings
-	# but it breaks old implementations
-	# [CG] $terr->{file} = 'string()';
+        # this would make it easier to recognize parsed strings
+        # but it breaks old implementations
+        # [CG] $terr->{file} = 'string()';
       #}
       #warn "Saving the error ",$terr->dump;
       $terr->{_prev} = ref($prev) ? $prev :
-	defined($prev) && length($prev) ? XML::LibXML::Error->new($prev) : undef;
+        defined($prev) && length($prev) ? XML::LibXML::Error->new($prev) : undef;
       return $terr;
     }
     sub _instant_error_callback {
       my ($saved_error) = @_;
       #print "CALLBACK WARN\n";
       if ( defined $saved_error ) {
-	#print "reporting a warning ",$saved_error->dump;
-	warn $saved_error;
+        #print "reporting a warning ",$saved_error->dump;
+        warn $saved_error;
       }
     }
     sub _report_error {
       my ($saved_error) = @_;
       #print "CALLBACK ERROR: $saved_error\n";
       if ( defined $saved_error ) {
-	die $saved_error;
+        die $saved_error;
       }
     }
 }
     chomp($str);
     $msg.=" ".$str."\n";
     if (($self->{domain} == XML_ERR_FROM_XPATH) and
-	  defined($self->{str1})) {
+          defined($self->{str1})) {
       $msg.=$self->{str1}."\n";
       $msg.=(" " x $self->{num1})."^\n";
     } elsif (defined $self->{context}) {