Changeset 1932

Show
Ignore:
Timestamp:
08/30/06 01:14:44
Author:
miyagawa
Message:

0.16: work with recent libxml2

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • XML-Liberal/trunk/Changes

    r1931 r1932  
    11Revision history for Perl extension XML::Liberal 
     2 
     30.16  Mon Aug 28 20:35:07 JST 2006 
     4        - Now works with libxml 2.6.26 (Thanks to charsbar) 
    25 
    360.15  Mon Aug 28 18:04:52 JST 2006 
  • XML-Liberal/trunk/lib/XML/Liberal.pm

    r1931 r1932  
    22 
    33use strict; 
    4 our $VERSION = '0.15'; 
     4our $VERSION = '0.16'; 
    55 
    66use base qw( Class::Accessor ); 
  • XML-Liberal/trunk/lib/XML/Liberal/LibXML.pm

    r1928 r1932  
    4949 
    5050    my @errors = split /\n/, $error; 
     51 
     52    # strip internal error and unregistered error message 
     53    while ($errors[0] =~ /^:(\d+): parser error : internal error/ || 
     54           $errors[0] =~ /^:(\d+): parser error : Unregistered error message/) { 
     55        splice(@errors, 0, 3); 
     56    } 
    5157 
    5258    # TODO: this if ... elsif should be pluggable, but depends on drivers 
     
    108114        return $remedy; 
    109115    } 
    110     elsif ($errors[0] =~ /^:(\d+): parser error : internal error/ && 
    111            $errors[3] && $errors[3] =~ /^:(\d+): parser error : Extra content at the end of the document/m) { 
     116    elsif ($errors[0] =~ /^:(\d+): parser error : Extra content at the end of the document/m) { 
    112117        my($line) = ($1); 
    113118        return XML::Liberal::Remedy::ControlCode->new; 
    114119    } 
    115     elsif ($errors[0] =~ /^:(\d+): parser error : internal error/ && 
    116            $errors[3] && $errors[3] =~ /^:(\d+): parser error : Extra content at the end of the document/m) { 
    117         my($line) = ($1); 
    118         return XML::Liberal::Remedy::ControlCode->new; 
    119     } 
    120     elsif ($errors[0] =~ /^:(\d+): parser error : Unregistered error message/ && 
    121            $errors[3] && $errors[3] =~ /^:(\d+): parser error : internal error/ && 
    122            $errors[6] && $errors[6] =~ /^:(\d+): parser error : Extra content at the end of the document/m) { 
     120    elsif ($errors[0] =~ /^:(\d+): parser error : Extra content at the end of the document/m) { 
    123121        my($line) = ($1); 
    124122        return XML::Liberal::Remedy::ControlCode->new; 
     
    128126        return XML::Liberal::Remedy::ControlCode->new; 
    129127    } 
     128    elsif ($errors[0] =~ /^:(\d+): parser error : Premature end of data in tag \w+ line \d+/) { 
     129        my($line, $value) = ($1, $2); 
     130        return XML::Liberal::Remedy::ControlCode->new; 
     131    } 
     132    elsif ($errors[0] =~ /^:(\d+): parser error : PCDATA invalid Char value (\d+)/) { 
     133        my($line, $value) = ($1, $2); 
     134        return XML::Liberal::Remedy::ControlCode->new; 
     135    } 
    130136    elsif ($errors[0] =~ /^:(\d+): parser error : xmlParseCharRef: invalid xmlChar value (\d+)/) { 
    131137        my($line, $value) = ($1, $2); 
    132138        return XML::Liberal::Remedy::LowAsciiChars->new; 
    133     } 
    134     elsif ($errors[0] =~ /^:(\d+): parser error : Unregistered error message/ && 
    135            $errors[3] && $errors[3] =~ /^:(\d+): parser error : Premature end of data in tag \w+ line \d+/) { 
    136         my($line, $value) = ($1, $2); 
    137         return XML::Liberal::Remedy::ControlCode->new; 
    138139    } 
    139140